Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get content published in other page
#3
Ok! i made it...

just use menu_data function and parent_slug tag:

i manage an old function discovered in an old post:

The getSubpagesList function (put in your functions.php theme file):

Code:
<?php        
    function getSubpagesList($parent) {

    $data = menu_data();    
    $parent = $parent . "/";
    $output = array();

    $output[] = '<ul>';
    
    foreach( $data as $menu) {
        if ($menu['parent_slug'] == $parent){
            $output[] = "<li><a href='" . $menu['url'] . "' title='" . $menu['title'] . "'>"
                                                    . $menu['title'] . $menu['parent'] . "</a></li>";
        }
    }
    $output[] = '</ul>';

    $menu_string = implode("\n", $output);
    echo $menu_string;
}    
        
?>

You can call where you want passing the slug of the parent page:

Code:
<?php getSubpagesList('events');?>


It shows all the pages with a particular parent slug
Reply


Messages In This Thread
Get content published in other page - by Soueb - 2009-08-19, 00:11:54
Get content published in other page - by webquadro - 2009-12-11, 22:04:44
Get content published in other page - by ccagle8 - 2009-12-14, 12:09:24
Get content published in other page - by focoves - 2009-12-16, 05:59:36
Get content published in other page - by focoves - 2009-12-19, 02:11:25
Get content published in other page - by melmoth - 2010-02-04, 22:03:52
Get content published in other page - by melmoth - 2010-02-05, 21:41:03
Get content published in other page - by melmoth - 2010-02-10, 19:32:26
Get content published in other page - by geggal - 2010-09-28, 05:30:45
Get content published in other page - by geggal - 2010-09-28, 06:04:57
Get content published in other page - by geggal - 2010-09-28, 06:35:27



Users browsing this thread: 1 Guest(s)