WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Need for a catagory that doesn't show up on the frontpage (8 posts)

  1. jthusgaard
    Member
    Posted 8 years ago #

    Hi

    Is there any way to make a post to a catagory that does not show on the frontpage of my site?

    If not is it possible to make different sections of pages so I can sort the way they show on the side-bar.

    I have a special "page" that should only be viewed via a link from the side bar.

    J;-)

  2. dedge
    Member
    Posted 8 years ago #

    See the FAQ for how to hide a category.

    And for how to sort page order.

  3. jthusgaard
    Member
    Posted 8 years ago #

    Entering:

    <?php
    if ((empty($_GET['cat']))&&(!preg_match('/wp-admin/', $_SERVER['REQUEST_URI']))) $cat = '-Bestyrelsen';
    ?>

    In my my-hacks.php file (same directory as wp-config.php) removes all catagories from the frontpage!!!

    Where is the my-hacks file to be placed?
    What am I doing wrong?

    J;-)

  4. TechGnome
    Moderator
    Posted 8 years ago #

    My notes:
    1) my-hacks.php goes in your blog root.
    2) regarding $cat = '-Bestyrelsen'; ... Bestyrelsen should have been the CAT ID of the category, not the name.

    -tg

  5. TechGnome
    Moderator
    Posted 8 years ago #

    Gah! Double posted by mistake. This one can be deleted.

    -tg

  6. jthusgaard
    Member
    Posted 8 years ago #

    Thanks, works like a charm now.

  7. jthusgaard
    Member
    Posted 8 years ago #

    Well it has worked like a charm for a long time. Now I have 2 catagories I don't want to show on the frontpage.

    Using:
    <?php
    if ((empty($_GET['cat']))&&(!preg_match('/wp-admin/', $_SERVER['REQUEST_URI']))) $cat = '-4, -5';
    ?>

    Does not work. How do I prevent Cat 4 and 5 from showing up on the index page?

  8. jthusgaard
    Member
    Posted 8 years ago #

    Solved the problem:

    <?php
    if ((empty($_GET['cat']))&&(!preg_match('/wp-admin/', $_SERVER['REQUEST_URI']))) $cat = '-4';
    ?>

    Worked for one catagory (4). Making catagory 4 parent to catagory 5 solved my problem

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags