Help bootstrap table : List post
-
I want to create a list of articles by category
but it does not work
Help me
my website : http://tttvn.esy.es/`<?php
$tag = get_the_category( get_the_ID() );
if ( $tag ) :
?>
<div class=”relate-title”>list post:</div>
<table class=”table table-striped”>
<thead><tr><th>post</th><th>date</th></tr></thead>
<tbody>
<?php
$t = $tag[0];
endif;
if ($t) {
$r = new WP_Query(array(‘posts_per_page’=> 8, ‘post__not_in’=> array( get_the_ID() ), ‘category_name’=> $t->slug ));
while ( $r->have_posts()): $r->the_post(); ?><tr><td><?php printf(‘%2$s‘, get_permalink(), get_the_title() ); ?></td><td><?php echo get_the_date(‘d-m-Y H:m’); ?></td></tr>
<?php wp_reset_postdata();
}?>
</tbody>
</table>
- The topic ‘Help bootstrap table : List post’ is closed to new replies.