• I am currently using this code (code shown below) to setup a dynamic navigation on the left side of a site so that when you click on a page when that page loads it shows all of the children (subpages) under that link.

    It works great, however I am trying to get the child pages (subpages) to show up in a smaller font with a different color background behind them. Basically trying to style them differently than the main links. I have tried numerous things over the past few months. Anyone have any ideas on making this work? I have checked web sites & tutorials, but nothing seems to be exactly what I am looking to do.

    <?php if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar(‘Sidebar’) ) : else : ?>
    <div id=”sidebartext”>
    <?php wp_list_pages(‘depth=0’);(‘sort_column=menu_order&child&title_li=’); ?>
    </div>
    <?php endif; ?>

Viewing 9 replies - 1 through 9 (of 9 total)
  • This is incorrect:
    <?php wp_list_pages('depth=0');('sort_column=menu_order&child&title_li='); ?>

    Try using:
    <?php wp_list_pages('depth=0&sort_column=menu_order&child&title_li='); ?>

    With regard to your styling problem, you’ll need to edit your theme’s stylesheet.

    Thread Starter verdipro

    (@verdipro)

    interesting the code I had has been working. I will try your code as well. Is it just a style sheet issue that needs to be fixed for the drop down menu? I have tried so many things so am lost at this moment. I am pretty sure I have tried changing the stylesheet & wrapping it around the php, but it did not work.

    Is it just a style sheet issue that needs to be fixed for the drop down menu?

    Probably but without seeing the site, I can’t offer any specific suggestions.

    Thread Starter verdipro

    (@verdipro)

    the site is: https://newjerseycommunitycapital.org/, if you click on about us you will see the links show up in the drop down. those links are supposed to look like: https://www.verdipro.com/clients/njcc/aboutus/

    Thread Starter verdipro

    (@verdipro)

    I am trying to do this while keeping everything dynamic so that any children pages added under parent pages show up on the site.

    The first thing you really need to do is sort out the markup errors on the page. You have what looks like an unordered list for your nav menu but there’s no list markup!

    Thread Starter verdipro

    (@verdipro)

    yup i replaced my code with your code. site navigation still shows up exactly the same so both codes seem to work, this is what the update looks like:

    <div id=”sidebar”>

    <?php if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar(‘Sidebar’) ) : else : ?>
    <div id=”sidebartext”>
    <?php wp_list_pages(‘depth=0&sort_column=menu_order&child&title_li=’); ?>
    </div><!– #sideBartext –>
    <?php endif; ?>

    </div><!– #sideBar –>

    Try using:

    <div id="sidebartext">
    <ul>
    <?php wp_list_pages('title_li='); ?>
    </ul>
    </div>
    Thread Starter verdipro

    (@verdipro)

    its weird, the code is missing the UL statements. If I add your code above it completely removes the nav text visibly (but the items are clickable on the left). The code on screen looks like:
    <div id=”sidebartext”>

      <class=”page_item page-item-15″>Home

      <class=”page_item page-item-2 current_page_item”>About Us
      <class=’children’>
      <class=”page_item page-item-30″>Who We Serve
      <class=”page_item page-item-32″>Holdings
      <class=”page_item page-item-34″>History
      <class=”page_item page-item-38″>NJCC Recognition
      <class=”page_item page-item-40″>Staff

      <class=”page_item page-item-42″>Board
      <class=”page_item page-item-44″>Glossary of Terms
      </>

      <class=”page_item page-item-49″>Products & Services
      <class=”page_item page-item-18″>Impact
      <class=”page_item page-item-52″>News Center
      <class=”page_item page-item-54″>Resources

      <class=”page_item page-item-57″>Support NJCC
      <class=”page_item page-item-4″>Contact

    </div>

    In my style.css I do have a tag for #children & #page_item.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Sidebar Issues Please Help’ is closed to new replies.