php - wordpress - proper foreach in array syntax -


i'm still novice @ php appreciated. i'm using custom menu display 4 posts, , each post i'd post thumbnail. code below, gives me invalid argument supplied error.

    <div id="stampnav">     <?php $pages = wp_nav_menu( array( 'container_class' => 'menu-header','theme_location' => 'stamp-menu' ) );      foreach($pages $pagg) {      echo get_the_post_thumbnail($pagg->id, 'thumbnail'); }     ?>     </div> 

you need call global $post , make query post thumbnail menu not return meta associated page, queries built in "menu" custom post type.

your other option create custom walker class nav menu.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -