Forums

Adding posts to pages other than the home page... (7 posts)

  1. HOCSA
    Member
    Posted 3 years ago #

    Good day

    I would like to know how I can make new posts on my blog that will:
    - NOT be shown on the home page, only on another page
    - be shown on the home page AND another page

    for example: the blog has a news section - i would like to post some "news" that i would like displayed on the home page as well as the News page... How do i do this? (i have already created categories for each of the pages)

    Blog available here

    Thanks in advance.

  2. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    You could modify the loop in your theme's index.php file to only show posts from the news category. See this page on query_posts().

  3. HOCSA
    Member
    Posted 3 years ago #

    thanks mfields...

    now the only thing is trying to make that code work in that index.php file...

  4. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    Place the following code before The Loop in your theme's index.php.

    <?php
       if (is_home()) {
          query_posts("cat=4");
       }
    ?>

    http://codex.wordpress.org/Template_Tags/query_posts#Usage

  5. HOCSA
    Member
    Posted 3 years ago #

    ok, did that... that has now taken away all posts on the home page away, and show only the post in category 4 (events). what i want it to do is show that post on the events page, which it is not...

    (would this not be easier over IM?)

  6. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    Sure, I can IM... send my an email through my site http://mfields.org/

  7. HOCSA
    Member
    Posted 3 years ago #

    great, email sent...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.