WordPress.org

Ready to get started?Download WordPress

Forums

Help with dynamic links (2 posts)

  1. Sagus
    Member
    Posted 9 years ago #

    What I'm trying to do is set up a page where WordPress runs all the seperate pages, based on categories. i.e., anything posted to the "Front Page" category would load on the mainpage, and then I could use a query string to link to all the other pages based on the category the posts are made under.

    Question is, how do I make it so the index displays only posts from one certain category by default, without adding a query string to the URL?

  2. Kafkaesqui

    Posted 9 years ago #

    Go to the top of your index.php template on the line just above:

    require('./wp-blog-header.php');

    and insert this:

    if (empty($_SERVER['QUERY_STRING'])) {
    $cat = "IDOFCATEGORY";
    }

    Change IDOFCATEGORY to the numeric ID for the category you want displayed on your home blog page.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.