Forums

"Hiding" Pages and sidebar widgets (3 posts)

  1. footprints.music
    Member
    Posted 2 years ago #

    I have a theme I am modifying. I want to have some pages (about 5 or 6) that will show up when someone clicks on a link on one of my pages. I don't want these pages to be a part of my Navigation menu. I downloaded a plugin called "Exclude Pages from Navigation" and installed it but the pages I create still show up in the navigation but just below the page it's "linked" to. Is there a way to not have it at all?

    Also, if someone could tell me how to use my existing theme's sidebar and new widgets that would be great. the widgets erase the sidebar items. Can it be done?!

    Thank you!

    Alex

  2. richarduk
    Member
    Posted 2 years ago #

    I'm guessing that you mean Pages, not posts, and that you're talking about links to Pages in the sidebar?

    In which case, exclude_tree <?php wp_list_pages('exclude_tree=7');?> would exclude all the child Pages of a parent Page with an ID of 7 - that's the way I'd do it.

    http://codex.wordpress.org/Template_Tags/wp_list_pages#Exclude_Pages_from_List

    If you want new widgets in a sidebar create two containers something like this:

    <div class="box" id="box6">
    <ul class="widgets1">
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(1) ) : ?>
    </ul>
    </div><!--Close box6-->
    <div class="box" id="box7">
    <ul class="widgets2">
    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(2) ) : ?>
    </ul>
    </div><!--Close box7-->

    Now in your functions.php add this:

    if ( function_exists('register_sidebars') )
    	register_sidebars(2);

    Most widgets churn out surrounding list elements, so once you've installed your widgets check View Source to see what they've done and amend the html above as necessary.

  3. footprints.music
    Member
    Posted 2 years ago #

    You rock Thanks! I'll try that

Topic Closed

This topic has been closed to new replies.

About this Topic