• As most of you, I am using the following tag to exclude pages.

    <?php wp_list_pages(‘exclude=5,12,27,31,32,34,35,40,59,66,67,72,73,91,92,93,111, 119,121,124&title_li=’) ;?>

    Does anyone know a possible way of getting pages to include instead of exclude? Every time I create a new page, I have to go into the code and exclude it in the header. Is there a way to avoid this?

    (This of course in not correct, but it would be nice if it was as easy as this:

    <?php wp_list_pages(‘include=1,2,6,9,11’) ;?>

    Thanks in advance.

Viewing 7 replies - 1 through 7 (of 7 total)
  • As far as I know there isn’t anything like that.

    What I did on some sites with many Pages – kept only a few as “parents” and made all the rest of Pages “children”. Then in the wp_list_pages tag used the parameter “depth=1” which shows only the top level Pages.
    Depending on the structure of your Pages/content it might work. Or not ??

    Thread Starter shull123

    (@shull123)

    That worked like a charm. The only thing now, is how to I get rid of “Pages?”

    I tried the following and didn’t have much luck.

    <?php wp_list_pages(‘depth=1’, ‘exclude=title_li’) ;?>

    or

    <?php wp_list_pages(‘depth=1 &exclude=title_li’) ;?>

    Any thoughts? Thanks again.

    Thread Starter shull123

    (@shull123)

    Thanks! That cleared it up for me. It helps if you read. Sorry, it took you helping me get started to understand the whole thing.

    Here’s the solution.

    <?php wp_list_pages(‘depth=1 &title_li=’); ?>

    It truly helps when you don’t reveal the solution in full; rather pointing me in the right direction with a knowledgeful smile.

    Thanks again for your help.

    LOVELY attitude! If everyone were like you….

    Could you mark this as resolved, at the top, please and thanks?

    ??
    Even I was “lovely” in this thread (as opposed to mean as I usually am described…)

    Well, moshu, I’ve never felt or said that about you. I know others have, but then, what THEY think is THEIR problem, not yours….

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Inclusion rather than exclusion’ is closed to new replies.