0

我有当前循环来显示帖子,但我似乎无法获得要填充的标题或内容。我错过了什么?

                <?php
        // LOOP ARGUMENTS
        $args = array( 'post_type' => 'cbd_slider', 'posts_per_page' => -1 ); // -1 Shows ALL Posts
        $loop = new WP_Query( $args );
        while ( $loop->have_posts() ) : $loop->the_post();

        // CUSTOM CONTENT
        $slideLink = get_post_meta($post->ID,"slideLink",true);
        $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail_name');
        $imgURL = (isset($thumb[0]) ? $thumb[0] : get_template_directory_uri() . "/images/placeholder.jpg");
        ?>


        <li class="clearfix"><!-- Start of featured slide -->
              <a href="<?php echo $slideLink ?>">
                    <img src='<?php echo get_template_directory_uri(); ?>/thumb.php?src=<?php echo urlencode($imgURL); ?>&h=330&w=496' alt='featuredimage'  /></a>

              <div class="description">
                    <h2>TITLE GOES HERE</h2>
                    <p>POST CONTENT GOES HERE</p>
                    <a href="<?php echo $slideLink ?>" class="more"> more </a>
              </div>
        </li><!-- End of featured slide --><?php /* END WHILE AND RESET QUERY */ endwhile; wp_reset_query(); ?>
4

1 回答 1

1

你试过the_title吗?代替<?php the_title(); ?>你的TITLE GOES HERE和?<?php the_content(); ?>CONENT GOES HERE

于 2013-01-11T22:40:06.703 回答