1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Wordpress: How to display links to child pages on parent page

Discussion in 'Content Management' started by VeryCheaptemplates, Dec 3, 2009.

  1. #1
    Hello,
    I have a static wordpress theme which uses pages instead of blog posts.

    When user clicks on a certain parent page ie, News, they should see links to the child pages ie "News 1, News 2"..etc.

    Make no mistake, the child page links should not show on every page, just on its parent page

    Can you use php wp_list_pages?

    I tried
    <?php wp_list_pages('child_of=9&sort_column=post_title&title_li=') ?> 
    PHP:
    but this only shows all child pages of Parent page number 9 on ALL pages, not on page 9 only


    Please send me a PM or post here if you can do this. I will compensate you monetarily.

    Thanks
     
    VeryCheaptemplates, Dec 3, 2009 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Try
    
    <?php
    $current_cat_id = get_cat_id(single_cat_title('', false));
      
    wp_list_pages('child_of='.$current_cat_id.'&sort_column=post_title&title_li=') ?>
    ?>
    
    Code (markup):
     
    s_ruben, Dec 3, 2009 IP