WordPress.org

Ready to get started?Download WordPress

Forums

Index.php -> only 1st Cat (10 posts)

  1. Cyberbat
    Member
    Posted 10 years ago #

    Hello!
    Could someone please help me :) ?
    How can I do if I want my index.php (1st page) just returns the posts from the 1st category (News for example) and I don't want to use index.php?Cat=1
    Cause the homepage returns all posts from all categories if just "index.php"
    Thanks :)

  2. codergurl
    Member
    Posted 10 years ago #

    put $cat = 1; in index.php before the includes.

  3. Anonymous
    Unregistered
    Posted 10 years ago #

    Thanx!

  4. mmenke
    Member
    Posted 10 years ago #

    Hi,
    usefull tip, but I have a related question. Could someone also tell me how to have one category nót show up on a page?
    I mean, if I would have cats 1 - 10, I don't want to display cat 5, how do I do this?
    I presume I can't put $cat = -5; in index.php before the includes or?
    Thanx...

  5. mmenke
    Member
    Posted 10 years ago #

    In case this was not clear:
    I don't want to display cat 5 -> I don't want to display the posts in cat 5

  6. Anonymous
    Unregistered
    Posted 10 years ago #

    mmenke, yes, you can put $cat = -5 I've tried it before and it worked.

  7. mmenke
    Member
    Posted 10 years ago #

    super, will try... thanks alot..!

  8. Maximus
    Member
    Posted 9 years ago #

    woot, found this through google
    thanks codergurl, it worked, woo hoo

  9. Anonymous
    Unregistered
    Posted 9 years ago #

    hmm..to have news only displayed you put $cat = 1; before 'includes' in index.php? I could only find one mention of include in index.php (and it didnt seem right somehow) and no mention of the $cat (variable? - forgive me i'm a complete newbie). Didnt work for me anyhow. Suspect I have some profound misunderstanding.

  10. pixelss
    Member
    Posted 9 years ago #

    i'm tryin to get the same thing to work, but i'm not able too, can some one help us out?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.