0

我正在尝试将一些标题文本添加到 div 位置,名为

<div id="slidecaption"></div>

所以在我的js中是代码:

slides                  :   [   <?php 
    //query
    query_posts(array('post_type'=>'slider',
                      'posts_per_page'=>'20'
                      ));

    //loop
    if(have_posts()) : 
        while (have_posts()) : the_post();
            //feature image
            $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
            $title = get_the_title();

            //echo slides
            echo "{image : '".$large_image_url[0]."', title : '<h1>This is a header</h1>', url : ''},";

        endwhile; 
    endif; 
?>]

我需要的是在上面的 div 中显示标题。我该怎么做?谢谢!

4

0 回答 0