Forums

exlcude home page & permalink structure (13 posts)

  1. xmatter
    Member
    Posted 1 year ago #

    here is the code:

    <div id="navbar">
         <ul id="nav">
            <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=&exclude=2,4,25,27');?>
         </ul>
       </div><!-- end menu -->

    Two questions:

    How do i exclude the home page with this code? The home page is set to the static page.

    Also, here is my permalink structure /%category%/%postname%/.html
    in order to exlcude, i had to go back and change the permalinks to default (page numbers) then add the numbers into the exclude, and then change back to my custom one.

    Is there a way to put the custom permalink ie about-us into the exclude?

    thanks

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=&exclude=2,4,25,27, N');?>

    where N = the id of your Home page. See identifying page ids.

  3. xmatter
    Member
    Posted 1 year ago #

    thank you, but the home has no ID but "home". does this relate to the fact that the home page is also the static page? when i hover according to the link you sent, it displays "Edit "home"".

  4. xmatter
    Member
    Posted 1 year ago #

    thank you, but the home has no ID but "home". does this relate to the fact that the home page is also the static page? when i hover according to the link you sent, it displays "Edit "home"".

  5. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    If you;re using a static home page, you'll have a Page listed in Admin -> Pages. You need to find the id of that Page using the method outlined in the link I gave above.

  6. xmatter
    Member
    Posted 1 year ago #

    the home page is static through admin > settings > reading settings.
    There is no page ID through the admin > pages on hover, only "edit home". and through the address bar, no page id either. when i go to admin > pages and edit the home page, it simply ends with .com/

    Any other thoughts?

    don't forget, my permalink structure is /%category%/%postname%/.html

  7. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    the home page is static through admin > settings > reading settings.

    What is the name of the Page you have chosen in the dropdown?

  8. xmatter
    Member
    Posted 1 year ago #

    the front page: home
    the posts page: blank (chose nothing)

  9. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Then find the page called Home in Admin -> Pages.

  10. xmatter
    Member
    Posted 1 year ago #

    thank you for all your help, but i wish i could send you a screenshot to show that there is no page ID or number or anything regarding the home page. I know how to exclude pages, but the home page threw me off since it had no ID, hence posting on the forums

  11. xmatter
    Member
    Posted 1 year ago #

    when i change the static page to another page, the link then becomes .com/home

  12. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    So you must have a page called Home!

    Site url?

  13. xmatter
    Member
    Posted 1 year ago #

    ok so here's what i had to do. I had to change the static page to something then change my permalink structure to "Default" then go get the page number. finally go it. now i must change everything back. esmi, thank you, and if you get time, please setup a local server with my setting posted above, and you will see that it wasn't easy to discover how to get that page ID

Topic Closed

This topic has been closed to new replies.

About this Topic