• Hello all.
    In my navigation bar, I am using wp_list_pages to list some static pages (https://mcdev.com/w/articles/), see the top.

    However, in another area I am using it to show a list of sub-pages (https://mcdev.com/w/articles/)…

    The problem is that in the nav bar, I am using display:inline.
    On the sub-pages, I need to use display:block.

    Is there a variable that I can use to tell them to use different styles?

    Bonus question:
    How can I include an article but exclude all of it’s children? If I can’t, i guess I can just manually link them in the navbar; there are only a few pages I want in navigation anyway.

Viewing 3 replies - 1 through 3 (of 3 total)
  • sure – create two headers… call in the 2nd header using an include rather than a “get” function, and establish the layout of the links in the CSS file.

    if you mean you want to include a category, but not it’s children (sub categories) then use:

    <?php wp_list_cats('children=0'); ?>

    https://codex.www.ads-software.com/Template_Tags/wp_list_cats

    Thread Starter scottmcdanielorg

    (@scottmcdanielorg)

    Oh, sorry. By article I meant ‘Page’. As in the navbar, I would like to have ‘Articles (id 14) listed, but not it’s children…and I don’t want to have to add all of the children to the exclude list everytime I add a subpage.

    Does that make sense at all?
    ??

    On the first point, you’re saying to create a seperate page, like ‘navbar.php’ that includes it’s own styles for .page_item, then import that where the nav section currently is, right?

    [EDIT]
    VVV Oooh, ok, I gotcha! Thanks.
    ??

    on the first point… i mean make “header2.php” – would be nearly identical to “header.php” except your navigation. then, where you want that header to show up, you call that one in. say on “single.php” (if that’s in your theme) instead of wp_get_header you’d use php include('header2.php')

    as far as listing pages and not subpages…
    https://codex.www.ads-software.com/Template_Tags/wp_list_pages

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_list_pages css problem…’ is closed to new replies.