Results 1 to 1 of 1
Apr 27, 2012, 15:38 #1
- Join Date
- Aug 2007
- 0 Post(s)
- 0 Thread(s)
[Wordpress] Help me solving a coding logic
I am developing a wordpress based website and need help in solving a logic.
What I am trying to achieve is to create a special page template which will have it's own blurb and then a list of posts from a specific category or Tag.
To visualize this, you all might have seen on blog posts that after the post content ends you get a list of related posts. I am looking for same thing but with few twists.
- I want it to be on a page
- I want to define the category or tag while creating the page
- I want to define the no of posts to be listed while creating the page
- Can I have pagination option too?
One solution in my mind is to create Custom page templates for each category and Tag, but I don't want to use that
Second solution is to have a page template with 2 loops, A regular one to get page content, then another one to list posts. I am planning to pass the Category name and no of posts through Custom fields, like
<?php $my_query = new WP_Query('category_name=CUSTOMFIELD1&posts_per_page=CUSTOMFIELD2'); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <!-- Do special_cat stuff... --> <?php endwhile; ?>
Any other solution/IDea?