嗨,我用这个代码从某个类别呼叫post
<?php
$queryObject = new Wp_Query( array(
\'posts_per_page\' => 3,
\'post_type\' => array(\'post\'),
\'category_name\' => \'photos-bet-awards-2013-2\',
\'orderby\' => \'date\',
));
// The Loop!
if ($queryObject->have_posts()) {
?>
<?php
while ($queryObject->have_posts()){
$queryObject->the_post();
?>
<a href="<?php the_permalink(); ?>" title="<?php printf(__( \'Read %s\', \'wpbx\' ), wp_specialchars(get_the_title(), 1)) ?>">
<?php the_post_thumbnail(\'betphumbs\'); ?>
</a>
<?php
$args = array(
\'post_type\' => \'attachment\',
\'numberposts\' => -1,
\'offset\' => 0,
\'orderby\' => \'menu_order\',
\'order\' => \'asc\',
\'post_status\' => null,
\'post_parent\' => $post->ID,
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
if(wp_attachment_is_image( $attachment->ID )) {
echo \'<a href="\'. get_attachment_link($attachment->ID) . \'"><?php the_title(); ?> </a>\';
break;
}
}
}
?>
<span class="entry-date"><font color="#999999">
<?php
$attachments = get_children(array(\'post_parent\'=>$post->ID));
$nbImg = count($attachments);
echo \'\'.$nbImg.\' photos.\';
?><br><b> <?php the_time(\'m/d/y \\a\\t g:ia\') ?></b></font></span>
<?php
}
?>
<?php wp_reset_postdata();
}
?>
现在我的问题是<?php the_title(); ?>
没有抓住帖子的标题how can i fix this?