/*Add this to your template and replace number 1 to your category number and also post per page*/
<?php $my_query = new WP_Query( "cat=1&posts_per_page=1" );
if ( $my_query->have_posts() ) {
while ( $my_query->have_posts() ) {
$my_query->the_post();
echo '<div id="blogi_loop">';
echo '<h4>';
the_title();
echo '</h4>';
the_time(get_option('date_format'));
the_excerpt();
echo '</div>'; }
}
wp_reset_postdata();
?>
This code add´s category loop to your wordpress template.
Its add number base category and post it title date and the content.
Its add number base category and post it title date and the content.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.