• Hi all!

    In my index I have a link list like this:

    INFO
    — Description
    — Where we are
    — Contacts

    Using “wp_list_pages(‘sort_column=menu_order&title_li=&child_of=2’);” I print the needed links:

    a href="https://www.sitename.com/?page_id=2"

    Now, what I need is to add a link before the page id. Something like this:

    a href="https://www.sitename.com/PAGENAME.PHP?page_id=2

    What should I do?… I tried with:

    $page_output = wp_list_pages('sort_column=menu_order&title_li=&child_of=2');
    str_replace('href=\"', 'href=\"https://www.sitename.com/PAGENAME.PHP', $page_output);
    echo $page_output;

    but it don’t works…

    Could you please help me out? Thank you so much in advance and sorry for my bad english but I’m italian!! ??

    Zam

Viewing 1 replies (of 1 total)
  • Here is an example with an external link and one specific page below that one at the bottom:

    <ul>
    <?php wp_list_categories('title_li=&include=9'); ?>
    <?php wp_list_pages('include=1209,96,557,219&title_li='); ?>
    <li><a href="https://www.mysite.nl/diversen/rondetijdenrekenhulp.xls" target="_blank">Rondetijdenrekenhulp</a></li>
    <?php wp_list_pages('include=698&title_li='); ?>

    I use this in my left-sidebar.php

Viewing 1 replies (of 1 total)
  • The topic ‘Add links to wp_list_pages’ is closed to new replies.