WordPress.org

Ready to get started?Download WordPress

Forums

Insert page-specific content & hide in navagation (7 posts)

  1. michael2572
    Member
    Posted 5 years ago #

    I would like to know what the best way is to:
    - Insert content from a specific page anywhere
    - Not have the page that the content is on displayed in the page list, navigation, or anything like that.

    I know various ways of pulling content by ID but I'm curious to know which works best for excluding it from everything else.

    Thanks.

  2. JarretCade
    Member
    Posted 5 years ago #

    It's easy to remove a link to the page or post from your navigation menu, a category list or something similar.

    Find the code in your theme where it is displaying your links and all that you have to do is use &exlcude=

    It will look something like....

    <?php wp_list_pages('title_li=&exclude=2'); ?>

    In that case it would hide the page with an ID of 2. Does that answer your question? If not, lemme know and I'll help you out more.

    You can also check out http://jarretcade.net/hiding-a-page-or-post-link-in-wordpress for a detailed explanation and walk-through :)

  3. michael2572
    Member
    Posted 5 years ago #

    Would that hide it from the search too?

  4. JarretCade
    Member
    Posted 5 years ago #

    The search meaning when somebody searches on your blog using the default search box? No, that just hides it from displaying a link to that particular post or page.

    Other then just creating a custom page and somehow providing a link to that would be the only way that I can think of to actually keep a page from showing up anywhere. You could make the page private and require people to give a password when they try to view it. I am not sure if making it private would actually hide it from search results though.

  5. michael2572
    Member
    Posted 5 years ago #

    Yeah, that's the thing. I'm trying to get a WP-Admin editable page, so I can easily edit any part of the page, wherever I want to insert the content.

    Seems that wordpress doesn't like it when it's told to not mess with a certain page.

  6. michael2572
    Member
    Posted 5 years ago #

    So no efficient way to do this?

    May I suggest, as a new feature, that pages may be hidden from everything with the check of a box?

  7. yoshi
    Member
    Posted 5 years ago #

    How about draft/private Post/Page?
    They do not appear on menus or search results, and you can use get_posts() with $post_status param to pull the content when you need.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.