The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get All Pages' slug
#6
Kumar, after you get the array back, YOU have to loop through it and build the unordered list / menu structure. Here is how I did it. I created a functions.php file in my theme folder and included it in my theme. Next, I put this function in my functions.php file.

Code:
function getMenu() {

    $data = menu_data();
    $output = array();

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

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

In my theme file, I added
Code:
<?php getMenu();?>

This isn't the only way to do it or even the best way, but it worked for me.

Regards,

Brian
Reply


Messages In This Thread
How to get All Pages' slug - by kumar - 2009-08-24, 04:24:50
How to get All Pages' slug - by ccagle8 - 2009-08-24, 04:32:06
How to get All Pages' slug - by kumar - 2009-08-25, 03:31:29
How to get All Pages' slug - by StilgarBF - 2009-08-27, 18:33:31
How to get All Pages' slug - by kumar - 2009-08-27, 20:37:00
How to get All Pages' slug - by bnowell - 2009-08-28, 01:52:03
How to get All Pages' slug - by kumar - 2009-08-28, 03:20:36
How to get All Pages' slug - by ccagle8 - 2009-08-28, 10:44:43



Users browsing this thread: 1 Guest(s)