Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Even with the Fold Categories plugin the “children=0” boolean doesn’t seem to work.

    Since I know nothing about coding, it took me a while to figure out how to edit the “exclude” argument in wp_list_pages so that it wouldn’t screw up the rest of the page. For the benefit of other nubs like me, I thought it might be worth while to detail it here:

    NOTE: All of this is mentioned in https://codex.www.ads-software.com/Template_Tags/wp_list_pages#Exclude_Pages_from_List, but it’s not really spelled out for code-illiterate people like myself.

    The wp_list_pages you want to edit is in the “header” php file in your theme editor. It might look something like this:

    <ul>
       <li><a href="<?php bloginfo('url'); ?>">Home</a></li>
       <?php wp_list_pages('depth=-1&title_li=');?>
    </ul>

    The arguments you’ll be using are:

    ‘exclude=12’ – where 12 represents the ID# of whatever page you want to exclude, and

    ‘title_li=’ – which removes the heading text above your page links (commonly and infamously seen as “Pages”)

    Putting them both together in the wp_list_pages tag will look like this:

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

    The two arguments are separated by an inclusive “&”.

    This worked for me, and erasing the ‘depth=-1&title_li=’ thing that was originally included in wp_list_pages didn’t seem to affect anything. I hope this helps, and I hope I didn’t make some lame mistake. lol.

Viewing 2 replies - 1 through 2 (of 2 total)