Support » Fixing WordPress » Need help: List custom field from parent page in menu

  • Hi!

    I’m making a menu with drop down child’s from parent page element, and would like to show a short description (custom field named ‘description’ from parent page) in the menu.

    Something like this;

    Home ¡ About ¡ Contact
    ¡ About me ¡ Here you can find some info
    ¡ About my girlfriend ¡ about me and my girlfriend.

    A picture of this, can be seen here;
    Can anyone help me with some code?

    Thank you!

Viewing 1 replies (of 1 total)
  • Btw, this is the code I got by now;

    function end_lvl(&$output, $depth) {
    			  'orderby' => 'title',
    			  'order' => 'ASC',
    			  'post_parent' => 0,
    			  'post_type' => 'page',
    			  'post_status' => 'publish',
    			  'posts_per_page' => -1,
    			  'caller_get_posts'=> 1
    			$my_query = null;
    			$my_query = new WP_Query($args);
    			if( $my_query->have_posts() ) {
    			  while ($my_query->have_posts()) : $my_query->the_post();
    				$link = get_post_meta($my_query->post->ID, 'link_url', true);
    				$text = get_post_meta($my_query->post->ID, 'Menytekst', true);
    			wp_reset_query();  // Restore global post data stomped by the_post().
    		$indent = str_repeat("\t", $depth);
    		$output .= '</div><div class="menu_info">'.$text.'</div>';
    		$output .= "$indent</ul>\n";

    And it works somehow, but the output “$text” is the same for every dropdown.

Viewing 1 replies (of 1 total)
  • The topic ‘Need help: List custom field from parent page in menu’ is closed to new replies.