• Resolved Moritz83

    (@moritz83)


    Hey guys,

    before I left home for a 2 month trip across the USA I created a “LIVE” page where I post stuff during this time. Unfortunately I forgot to look for an archive solution. I’ve done the following to separate the posts

    index.php

    <?php if (is_front_page() && !is_paged() )
         $posts = query_posts($query_string . '&cat=-5'); ?>

    page_live.php (child theme template)

    <?php query_posts( 'cat=5' ); ?>

    It’s separating the posts but when I click on older posts it will merge both categories to one archive. Is there a quick fix to generate an archive for category “1” and for category “5”? I have only my netbook with me so I’m a bit limited in coding :/

    Here is the link: Link

    Thanks in advance
    Moritz

Viewing 1 replies (of 1 total)
  • Thread Starter Moritz83

    (@moritz83)

    okay, here is the quick fix:

    change

    <?php query_posts( 'cat=5' ); ?>

    to

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=5&posts_per_page=5&paged=' . $paged); ?>

    and add

    <?php twentytwelve_content_nav( 'nav-below' ); ?>

    maybe not the best solution but it’s working until I get home ??

    Thanks anyway

Viewing 1 replies (of 1 total)
  • The topic ‘Archive for each category’ is closed to new replies.