• Resolved mikebell250

    (@mikebell250)


    I am using a template with a 3rd column and I’m having trouble getting Pages into menu order and excluding pages from the list having had Pages moved from sidebar to the 3rd column.

    This is what the code currently looks like while I have been experimenting:

    <ul>
    <? // php wp_list_pages('title_li=<h2>'.$blog_navigation.'</h2>'); ?>

    <?php wp_list_pages('sort_column=menu_order&title_li=<h2>' .<br />
    __('Pages') .<br />
    '</h2>' ); ?>

    <?php wp_list_pages('exclude=21&title_li=<h2>' . __('Pages') . '</h2>' );<br />
    ?>
    </ul>

    So I have two Pages headings, one has an alpha list and one a menu list but both have the page I’m trying to exclude.

    https://www.vitalelders.org

    Can anyone help? I am not a techie so have been getting some help so far.

    Regards

    Mike

Viewing 6 replies - 1 through 6 (of 6 total)
  • Why do you need two list of Pages?
    (you have even a third one… commented out at the top)

    Thread Starter mikebell250

    (@mikebell250)

    I don’t. I’m trying to find one that will exlude pages. Sorry I did not make myself clear.

    Is it possible to exclude pages in a 3rd column that is not a sidebar or only in a sidebar?

    Mike

    It doesn’t really matter where you have that template tag. The important thing is to have the exclude parameter in it.
    Use this one:

    <ul>
    <?php wp_list_pages('exclude=21&title_li=<h2>' . __('Pages') . '</h2>' ); ?>
    </ul>

    and delete everything else. Or, if you want the exclusion AND sorted by the order you define in the admin, add the sort_column

    <ul>
    <?php wp_list_pages('exclude=21&sort_column=menu_order&title_li=<h2>' . __('Pages') . '</h2>' ); ?>
    </ul>

    Thread Starter mikebell250

    (@mikebell250)

    Thanks Moshu and it does not work

    I have cut and pasted your code, I’ve even created a new page and changed its number in Page Order in Create New Page and in the code, and still the page shows on the Pages list on the home page.

    Any other suggestions?

    Mike

    I am afraid you misunderstand the basics.
    1. The page ID# is generated by WP – you cannot change it. WHen you want to exclude a Page from being listed, you use the Page ID#.
    2. The “Page Order” – as the name suggests – will determine the order in which the Pages are displayed. It goes in two steps:
    a) include “sort_column=menu_order” in the template tag
    b) change the order numbers in your admin interface

    The above 1. and 2. have nothing to do with each other. I may be naive but somehow I always assume people do read the Codex before starting to play with a template tag:
    https://codex.www.ads-software.com/Template_Tags/wp_list_pages

    Thread Starter mikebell250

    (@mikebell250)

    Thanks Moshu. Things are now clear.

    And I did ready the codex, it’s just that they are written for people who know what they are doing!

    Mike

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘exclude pages problem’ is closed to new replies.