I guess you need this function
get_the_post_thumbnail_url($menu->object_id);
(provided menu item is not a custom link)
$menu->ID is not the id of the post/page it is linking to.
About calling meta yes it is also possible
$image_url = get_post_meta( $menu->object_id, 'meta_key', true );
Related Posts:
- Parsing Menu Items and Blog Posts
- Disable Attachment Pages Completely
- Print number of post (in reverse)
- WP Insert Post function – Insert Post Thumbnail
- Trying to add attribute to my posts’ featured image
- Best practice for migration friendly images in posts/pages?
- get_the_title() gets printed out twice
- Redirect to another page using contact form 7? [closed]
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- Display related posts without a plugin
- Show About and Contact Us page when they’re clicked in the top menu.
- Apply class to every third list item? [duplicate]
- Error display post thumbnails for previous and next post
- How to pick “full/thumbnail” images in the loop?
- WordPress Search
- Edit and delete permissions pages and posts
- My worpress search page is showing no results
- How can I check if a post with a particular slug or title exists?
- How to put 2 php codes in functions.php without site crashing
- Split post or page content in two or more columns
- Having trouble with customizing blog posts on the home page
- Getting page / post URL on publish and / or update
- Get current_post in reverse order with pagination
- Basic PHP question (displaying post title over thumbnail) [closed]
- insert thumbnail image from php script
- Can’t put a hyperlink on Featured Post’s Image
- List of child pages fetch next results at link click
- What’s the best way to use the Featured Image for responsive web design?
- Inject post (from specific category) between posts in Loop
- Create WordPress pages with PHP
- renaming an admin menu item with decimal array index number
- How to get year, month and hour in WordPress?
- Is it possible to generate a page without create in the admin?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How to add a featured image to a existing post via php?
- Replacing the NavWalker dropdown element
- How to add specific menu on a specific page or pages
- Count number of published posts by type
- selected menu item
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- Get taxonomy terms only of the WP_Query current posts
- How to get 2 or multiple custom post types in wordpress functions.php
- Custom Template 404 for specific custom post type
- Can’t load WP function into external function
- Displaying a button on each post
- How can I add pagination and how can I change thumbnail size?
- Creating bulk posts with Youtube videos
- Show comments menu in dashboard only if the site has comment
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Count top level menu items
- Getting a specific post values to another div or modal
- Unreadable pagination
- how do I get a specific post from a post with a subcategory in WP
- My page.php shows the index.php
- Open post-content in archive page in a Modal box with bootstrap
- Add item to top of menu using a filter in functions.php
- ‘Post-thumbnails’ feature does not seem to register
- What’s the best way to include PHP code in pages?
- Load Posts on Click via Ajax into a DIV
- create front-end users post list by specific category
- Adding Additional Variables on Menus Page
- Fallback image URL if no featured image exists via a shortcode function
- form $_post action value gets truncated after it passes through two forms
- Toolbar Hidden in a Virtual Page
- Get the alt text of the image in a array
- Class for Selected Menu using wp_nav_menu
- Wp Query : Order by distance lat,lon
- get value from get_post_meta then reuse it in another get_post_meta
- WordPress Post Block Element not properly parsed with the_content filter
- Build A Custom SQL Query for WordPress Search
- WordPress Custom Form – Getting Query Vars, Weird Glitch?
- How to Send Pingbacks for all Posts in WordPress?
- Featured image in menu wordpres
- Display articles with a different template in the home page | Solved |
- WordPress sorting posts by date and title using a dropdown
- Replace background image with post thumbnail in shortcode
- Category Page Displaying all Pages
- Trying to get post ID outside loop on blog page
- Enqueue script only on child pages of custom post types
- Attach and retrive multiple pdf files to post or page
- Get list of posts from attachment
- PHP warning with code for nav menu walker [duplicate]
- String replace for Login/Logout concatenation problem in menu
- Thumbnail wouldn’t scale to size properly
- When working with a post, almost all wp_postmeta are deleted
- How to tell if a page has subpages for Custom Post Types
- Displaying POST content with HTML tags and all
- Using WP page password protection as defacto login
- Pagination in WP Queries
- Newbie question. Login/Registration. New PHP page
- Add div after every 4 posts then every 2 posts for a responsive loop
- Adding my own custom template page but got white page
- wp_nav_menu prints children with parent name
- WP Admin Bar – Get current theme name as custom menu title
- How to map my php files as the files for pages
- Post Thumbnail on Single (if elseif else)
- How to add feature image url in my template file and content as well?
- the_post_thumbnail unless video id is added
- Submenu opened problem
- How to display the date under the post title?