WordPress.org

Ready to get started?Download WordPress

Ideas

Hidden Page Option

  1. bazza2000
    Member

    12345

    By default all pages created are shown via the

    wp_list_pages

    function.
    The only way to exclude pages is to hardcode the sidebar code i.e.

    wp_list_pages('exclude=23,28,29')

    A better solution would be to have an option on page creation to exclude the page.

    Posted: 7 years ago #
  2. Doug Smith
    Member

    12345

    Yes, it would be so nice for this to be easily changed by someone who doesn't have the skills to delve into the page code.

    (It's unfortunate that the title of this idea is "hidden page option" because it doesn't really hide a page. It simply stops a page from being listed, usually in the theme's sidebar or navigation area. I use this extensively on some sites where I have pages available by links throughout the site, but there is no need for them to clutter the sidebar.)

    Posted: 7 years ago #
  3. kilwag
    Member

    This would be a good option for categories too,

    or to limit the depth of subpages and subcategories

    Posted: 7 years ago #
  4. Mark
    Member

    12345

    Yeah, this is a great idea, and very important for those of us who are using WordPress as a CMS.

    Posted: 7 years ago #
  5. Isn't this already part of WordPress 2.1?

    Posted: 7 years ago #
  6. dansinch
    Member

    12345

    "Isn't this already part of WordPress 2.1?"

    If it is I'd love to know how to do it.

    Posted: 7 years ago #
  7. wjnielsen
    Member

    In the mean time here's how I've worked it. I do have the Role Manager plugin installed. Then, on the content that I want to show based on user class, I use the following:


    if($user_level > 1 )
    {

    if ( wp_list_pages("child_of=".$post->ID."&echo=0") )
    {
    wp_list_pages("title_li=&child_of=".$post->ID."&sort_column=menu_order");
    }

    }

    If you were the supreme administrator ($user_level == 10), you were the only person with a $user_level == 10, and you wanted pages to only appear for you, all you would need to do is change the if($user_level > 1 ) statement to if($user_level > 10 ).

    Whatever code goes within the if statement (e.g., this works within the loop too) will only show IFF the user exceeds the needed $user_level. Other operators of course will work (e.g., <, <=, >=, ==, !=).

    Posted: 5 years ago #
  8. AndreyFrolov
    Member

    Wjnielsen: Would not help a lot to the ppl without PHP knowledge. Also you have a typo (>10 wont include 10)

    Posted: 5 years ago #
  9. bluebird2
    Member

    12345

    I second it.

    Posted: 5 years ago #
  10. Pete
    Member

    an easy way would be to alter the page order functionality in the current WP core so that the default value is 1 instead of 0 and then make 0 = hidden. So all you need to do to make it hidden is type in 0 in the page order part of a post/page

    Posted: 5 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    127 Votes
  • Status

    This is plugin territory