I am developing a website using WordPress. As I don't want the sidebar, I removed 'get_sidebar()' from my page. But I need to place a category in the content part (like a category for latest news) - not in a sidebar. How could I do this?
1 Answer
You can do this with a query
<ul>
<?php
global $post;
$args = array( 'posts_per_page' => 5, 'offset'=> 1, 'category' => 1 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
You can put that in your category page or in something like Exec-PHP plugin
For looking up the current category you can grab it like
get_query_var('cat')