• I posted and earlier question “sidebar on separate page” but due to lack of responses, maybe that’s impossible to code.

    So my new question is this:

    How can I prevent a certain page that was created with the “Create Pages” option in WP 1.5 from being displayed in the sidebar under the “Pages” section.

    Example:

    From this:

    Pages

    Heading South
    Last Winter
    Menu
    Ready To Travel

    To this:

    Pages

    Heading South
    Last Winter
    Ready To Travel

    In other words, the Menu page still exists in the database, you can link to it from a navigational menu, you can display the sidebar info in the menu page, …

    But,

    The page itself is not displayed on the index page under the “Pages” section.

    Is this possible to do ?

    Thanks,

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter rvblog

    (@rvblog)

    @rustindy:

    Damn it, it did’t work.

    I created a new template called menu.php, created a new page in WP called menu (with ID # 16), edited the sidebar.php file and included the “&exclude=16” code in the file, then uploaded.

    The address https://www.mysite.com/menu opened the menu.php template ok, the header and footer files were also included ok, the title <h2>Menu</h2> appeared on the screen on, …

    But then I got this:

    Parse error: parse error, unexpected ‘=’ in

    I’m sure I followed your example to a T – even tried including a space between the end bracket and the & character and that didn’t work either.

    Any ideas ??

    Moose, yup, as soon as we nail it down ??

    <?php wp_list_pages('title_li=<h2>' . __('Pages') . '</h2>&exclude=69,66' ); ?>
    would exclude pages 69 and 63. Make sure there’s no single-quote between the numbers. It’s the exact same syntax as the exclude argument for wp_list_cats.

    Your exact line in the sidebar.php template file should read:
    <?php wp_list_pages('title_li=<h2>' . __('Pages') . '</h2>&exclude=16' ); ?>

    Just copy and paste ?? Let me know. It’s possible WP doesn’t like this because you’re ON page 16 but it’s trying to exclude it from the pagelist in the sidebar.

    EDIT: Gads I hate posting code in this thing ??

    And i’m not editing it again!!! Obviously, I meant pages 69 and 66 in that top paragraph ??

    Thread Starter rvblog

    (@rvblog)

    Yes, I did it exactly like that. I inserted:

    <?php wp_list_pages(‘title_li=<h2>’ . __(‘Pages’) . ‘</h2>&exclude=16’ ); ?>

    and got the error:

    Parse error: parse error, unexpected ‘=’ in

    Weird – just tested it and it worked fine here.

    https://russ.innereyes.com/menu.txt <– an example menu template

    https://russ.innereyes.com/sidebar.txt <– the line for sidebar.php to exclude page 16 from the menu

    These are exactly what I used (except my menu.php file has the Kubrick div tag in it) and it worked fine (looks stupid, but works).

    Thread Starter rvblog

    (@rvblog)

    Yes it works fine now

    Your first example template had this code:

    <?php
    /*
    Template Name: Menu
    */
    ?>

    <?php get_header(); ?>

    <div id=”content” class=”widecolumn”>

    <h2>Menu:</h2>
    <?php get_sidebar(); ?>

    </div>

    <?php get_footer(); ?>

    Your second example, the one I just used had this:

    <?php
    /*
    Template Name: Menu
    */
    ?>

    <?php get_header(); ?>

    <h2>Menu:</h2>

      <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    Maybe including the <div> in the first example caused the error, and eliminating it in the second example corrected the problem.

    Regardless, it now works the way I want it to and I thank you for having the patience and sticking it out with me through this issue

    Thanks tons

    No problem ??

    Actually, thanks to the wonky way this forum makes you post code, my example template file above ended up with a lot of double-quotes instead of single-quotes. That’s likely what the problem was, and why I just slapped those text files on my server ??

    Have fun!

    It’s been a while, so I thought I would refresh this thread…

    I’m a beginner with WordPress, and although I get the manual exclusion mentioned by rvblog on 2005-01-12, I was wondering if anyone has found/created a plugin that would allow you to hide pages from the dashboard when creating or editing a page.

    Cheers!

    The exclude code works in most cases but if you have a main page (parent page) with some subpages and you exclude the main page an error occures. With cats it’s possibly to hide all by hiding the top category.
    With pages not?
    If I exclude each subpage too, the problem doesn’t occure.
    But I don’t wan’t to change the exclude code each time I create a new subpage.
    Any suggestions would be really welcome.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘How can I hide a page ?’ is closed to new replies.