Forums

[resolved] Hard Code a list item into a sub page with list_pages (4 posts)

  1. mitchrenton
    Member
    Posted 6 months ago #

    I didn't quite know how to verbalise the title so thanks for getting this far!

    I'm looking to use list_pages so pages are dynamically added to the navigation but I have 2 or 3 sub navigation links that I want linked to external sites that aren't actually pages.

    I know that adding a list item is easy enough on parent navigation but im having trouble finding a way to add a list item manually in the sub navigation.

    I should probably add that it is a drop down menu.

    Any advice or help would be greatly appreciated.

  2. blogbreaking
    Member
    Posted 6 months ago #

    you could use the title_li= parameter for wp_list_pages. This will remove the default unordered list tag and all you to add in your own
    list items after the call.
    example:

    <ul>
    <?php wp_list_pages('title_li=');
    
    <li><a href="#">Hard code Link 1</a></li>
    <li><a href="#">Hard code Link 2</a></li>
    </ul>
    </li>
    </ul>
  3. MichaelH
    moderator
    Posted 6 months ago #

    I'd still do the sub-page thing, just use this plugin to cause those sub-pages to redirect to your external sites:

    http://wordpress.org/extend/plugins/page-links-to/

  4. mitchrenton
    Member
    Posted 6 months ago #

    Thats great guys thankyou.

Reply

You must log in to post.

About this Topic