• Hello,
    I’ve done a fair bit of searching and playing around trying this and that but am having no luck.
    What I want to do is create a page called ‘Podcasts’ and when clicked on it takes you to the page which shows all of the posts that are in the ‘podcast’ category.
    Can someone please help me out on this one as I know it is a simple task but I am having no luck.
    If you need to my wordpress install is located at hundredpennies.com
    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • Find out the category ID of “Podcast”. It should be a number. For this example lets assume that the number is 15. Now, copy the index.php page out of your theme folder. Rename the file category-15.php Where 15 is the category ID for “Podcast”. Now, put your new file back in your theme folder. To point to that page have any links that you want to point to that page carry this URL: http://www.hundredpennies.com/category/podcast/

    That should produce a separate page that only displays post in the podcast category.

    Thread Starter mrbrut

    (@mrbrut)

    awesome thank you for your help. another question, how do i now create a page that will now display the contents of category-15.php?

    mrbrut,

    Visited your site and apparently you found a solution to your question–there is a Podcast link on the menu bar.

    Would you mind sharing how you did it?

    Thread Starter mrbrut

    (@mrbrut)

    i created a file called ‘podcast.php’ and made sure that it had the template name at the top. my podcast category is 21 so i put in a query so that it displays that category.

    hopfully to make sense i’ll include the page below and if you have any questions please let me know. it was actually quite easy once i understood how a page is made up and queries etc… i guess it’s all part of the learning experience!

    <?php /*
        Template Name: Podcast
    */ ?>
    <?php get_header(); ?>
    <?php
        if (is_home()) {
        query_posts("cat=-21");
        }
    ?>
    
    <?php
        $events_cat = '21'; 
    
        if (!is_paged()) {
            query_posts('cat=' . $events_cat);
        } else {
            query_posts('cat=' . $events_cat . '&paged=' . $paged);
        }
    ?>
            <?php include (TEMPLATEPATH . '/theloop.php'); ?> 
    
        </div> 
    
        <?php get_sidebar(); ?> 
    
    </div> 
    
    <?php get_footer(); ?>

    Sweet the coding part works for me sofar…

    I was just wondering – how can I get a header for the “new” Page? It “only” shows the posts in the specific category!

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Create page which includes one category’ is closed to new replies.