Forums

Using Query Posts code as shown... should bring up archive template? (3 posts)

  1. Roar
    Member
    Posted 7 years ago #

    <?php query_posts('cat=1,2');?>

    If I include the above at the top of my index.php, it bypasses the real index page and opens one that says:

    You are browsing the BlahBlah Category Archives (BlahBlah=Cat#1)

    Did I muck something up in that code?

    Thanks!

  2. Joshua Sigar
    Member
    Posted 7 years ago #

    When you pass cat=2 to query_post, WP will load one of the templates in the following priority order.

    1. category-2.php
    2. category.php
    3. index.php

    So, in your case, most likely that category.php template is the one that is loaded.

    If it's for frontpage, you might want to try the following plugin.
    http://dev.wp-plugins.org/file/front-page-cats/trunk/front_page_cats.php

  3. Roar
    Member
    Posted 7 years ago #

    Thank you that works, but then it undoes the Image Headlines Plugin.

    *tears out hair*

    Oh well, I guess I will have to choose which is more important.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.