Show posts from a single category on a page the way they're shown on the main
-
Hi,
The topic might be a little confusing, so let me explain.
I have a travel blog, on which I add posts from countries into categories. Instead of search I’d like the users to use https://www.podroznikowo.pl/mapa to navigate and search older posts.
When clicked on a country it would redirect them to a page https://www.podroznikowo.pl/slowenia-2 which would show the posts.
Up to this point I was able to get posts from a category, but I’d liek them to be shown like on the main page https://www.podroznikowo.pl/
the code I have now is:
<?php
/* Template Name: Slowenia */get_header(); ?>
<div id=”primary” class=”site-content”>
<div id=”content” role=”main”><?php query_posts(‘cat=4&showposts=4’); ?>
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( ‘content’, get_post_format() ); ?>
<?php endwhile; ?><?php endif; // end have_posts() check ?>
</div><!– #content –>
</div><!– #primary –><?php get_sidebar(); ?>
<?php get_footer(); ?>Could you please help me?
- The topic ‘Show posts from a single category on a page the way they're shown on the main’ is closed to new replies.