• Hi WordPress community,

    I’m trying to create a half predefined half dynamic navigation below:

    <div id='cssmenu'>
        <ul>
            <li class='active has-sub'>
                <a href='<?php echo get_page_link(1); ?>'><span><?php echo get_the_title(1); ?></span></a>
                <ul>
                    <li><a href='#'><span>SUBNAV of id1</span></a>
                </ul>
    	</li>
    	<li class='active has-sub'>
                <a href='<?php echo get_page_link(2); ?>'><span><?php echo get_the_title(2); ?></span></a>
    	    <ul>
    		<li><a href='#'><span>SUBNAV of id2</span></a>
    	    </ul>
    	</li>
        </ul>
    </div>
    </div>

    The top level navigation needs to stay predefined due to the website design / responsive reasons.

    But I need for the SUBNAV items to be dynamic? for example id1 may have 4 SUBNAV items and id2 may have 2 items. How would I go about doing this?

    Any help would be much appreciated ^_^

Viewing 5 replies - 1 through 5 (of 5 total)
  • This is probably possible, but the specifics would depend on what the subitems are. You could run The Loop again or the subitems could be added via JS.

    Thread Starter @PhilipHoy

    (@venomphil)

    I cant say i’m the most skilled at this type of problem.

    The subitems are just the items that have the ids1 and id2 as their parents

    If I was just using the default WP menu, It would look like this ^^

    Parent – id1
    Subitem 1
    Subitem 2
    Parent – id2
    Subitem 3
    Subitem 4

    What should the subitems be? Links to blog posts? Links to static pages? Links to external websites?

    Thread Starter @PhilipHoy

    (@venomphil)

    I forgot to mention I’ve set the blog up as a website and the subitems are links to the static pages

    Thread Starter @PhilipHoy

    (@venomphil)

    Hi Stephen,

    Thanks for all the help so far – Do you have any further thoughts on how this could be accomplished?

    If anyone else is reading this and knows of a solution, please jump in ^^

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Navigation half predefined half dynamic’ is closed to new replies.