/*Add this to your template and replace number 1 to your category number*/
<?php $my_query = new WP_Query( "cat=1" );
if ( $my_query->have_posts() ) {
while ( $my_query->have_posts() ) {
$my_query->the_post();
echo '<h1>'; the_title();
echo '</h1>';
the_content();
}
}
wp_reset_postdata();
?>
This code add´s category loop to wordpress template.
It haves title and content codex to add simple h1 title and content text.
It haves title and content codex to add simple h1 title and content text.
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.