xác thực google maps

[hỏi] cách lấy 1 đoạn nội dung và hình ảnh bài viết ra trang chủ website ở wordpress

Thảo luận trong 'Hỗ trợ Lập Trình, Mã Nguồn' bắt đầu bởi hungnghean, 19 Tháng năm 2015.

Lượt xem: 2,907

  1. hungnghean

    hungnghean Thành viên nhiệt tình

    Bài viết:
    673
    Đã được thích:
    120
    Các bạn cho mình hỏi với:
    Cách lấy 1 đoạn nội dung và hình ảnh bài viết ra trang chủ website ở wordpress
    ở theme mình file index.php có code
    Mã:
    <?php get_header(); ?> 
    
    <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Home': endif;?>
    
    <?php get_footer(); ?>
    function có code
    Mã:
    <?php
    /*
    WARNING: This file is part of the core Genesis framework. DO NOT edit
    this file under any circumstances. Please do all modifications
    in the form of a child theme.
    */
    
    /**
    * This file calls the init.php file, but only
    * if the child theme hasn't called it first.
    *
    * This method allows the child theme to load
    * the framework so it can use the framework
    * components immediately.
    *
    * This file is a core Genesis file and should not be edited.
    *
    * @category Genesis
    * @package Templates
    * @author StudioPress
    * @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
    * @link http://www.studiopress.com/themes/genesis
    */
    
    require_once( dirname( __FILE__ ) . '/lib/init.php' );
     
  2. truongcanhht

    truongcanhht Thành viên

    Bài viết:
    197
    Đã được thích:
    28
    đoạn code bạn chia sẻ ở trên không phải đoạn lấy ảnh thumbnail và nội dung bài viết mà lấy widget có trong slidebar của theme. Để lấy ảnh và một đoạn nội dung bài viết bàn tìm hiểu hai hàm sau trong wp : the_post_thumbnail và the_excerpt