the_post_thumbnail()
echo
s content. This is explicitly stated in the Codex, and the function name follows the WordPress convention (mostly) that function names starting with the_
echo
content.
Display the Featured Image (previously called Post Thumbnails) for the
current post, as set in that post’s edit screen.
The thumbnail will display as soon as that line in the walker executes. The thumbnail markup won’t be concatenated into your string as it should be.
You need get_the_post_thumbnail()
instead, which follows the WordPress convention that functions starting with get_
return
content. Many, but not all, the_
functions have get_
sibling functions.
Related Posts:
- What is a good resource to find out about making custom walkers?
- Comment Walker vs. Comment Callback
- Why is my menu order not working with wp_nav_menu?
- Incrementing a class in a custom walker
- Adding ul class with wp_list_categories Custom Walker
- how to conditionally add attributes to start_lvl() function?
- Menu location by menu id or menu ID in start_el() Walker
- Adding dynamic content to end_lvl in Walker Class [closed]
- Walker gives additional taxonomy name?
- $args->has_children not working with start_el()
- Limit Custom Crawler to front end only
- ol children instead of ul children
- Extend Walker Class for 2 checkbox taxonomy selection?
- using walker menu to add classes and attributes to elements
- Custom megameu walker need improvement
- List pages to show only Whitelisted sub pages
- Get Parent List Class for Child Pages Using Walker
- Manual use of Walker_Category class
- How do I get_the_content in a custom walker?
- Creating Custom navigation in wordpress with sub menus
- How to remove ul & li from wordpress custom walker?
- Is it possible to display the Navigation Menu without using Walker_Nav Class
- Walker_Category – not reliably saving
- Custom Walker menu depth opening problem
- How to append something before final tag in walker class?
- Using wp_list_categories or other function inside a menu walker?
- Walker to add Bootstrap markup for wp_list_pages
- Help with output of post classes using apply_filters
- Custom walker pulldown display current page
- Menu items description? Custom Walker for wp_nav_menu()
- Using a menu walker add a custom item at the end of the menu’s items
- Mega Menu Walker
- How Does The Walker Class Work?
- How to create this custom menu walker?
- How do I pass an argument to my custom walker?
- Customizing Walker_Nav_Menu
- Extend walker – navigation, adding data attribute to a tag
- Check if wp_nav_menu items have submenus
- start_lvl on Walker is not working
- Nav walker, bootstrap: Display 3rd level items under 2nd level
- how to change WordPress menu markup/classes
- Benefits of using Nav Walker?
- Custom Nav Walker to show siblings and children of current branch?
- Use walker for specific menu, or avoid use of walker
- Add custom html to nav_menu
- has_children in custom nav_walker
- How to construct a custom html for submenus
- Nav Menu – Add class based on meta keys
- Create wordpress header with custom logo in between the menu splitting the menu into two equal parts [closed]
- Can’t extend some core classes
- Get Current Menu Location inside Nav_Walker
- View h2 content tags of a page in sub menu
- Change an li class name in a wordpress custom menu walker
- Custom walker nav – Add sequential number as class
- Append a code when at the current page in wp_list_pages()
- WP Menu Walker – How to know total depth from inside the start_lvl() method
- How to add ID attribute to each submenu?
- Why does the argument list_only do on Walker_Category_Checklist::start_el?
- Automatically adding new post categories to menu
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- Determine the last child of the parent menu WP Nav Walker
- Create a MegaMenu using a walker and the start_lvl function
- Issue on Adding A Class to Bootstrap Navbar Walker Dropdown
- Create menu / submenu from category subcategory and posts
- Navigation doesn’t render when wp is hosted
- Change submenu markup
- getting the current sub item out of total sub items in a given dropdown (custom walker)
- How to use a start_el variable in start_lvl
- Split into two seperate unordered lists with custom walker
- Customize existing menu item
- Show children (sub-navigation) of active menu item only
- wp_list_categories walker without links on categories that have subcategories (to make a nested dropdown menu)
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- Extend Menu Walker Output
- Walker Class: Output Parent Description and Featured Image right after sub-menu?
- Modifying the walker to insert parent’s description above sub menus
- How to get selected taxonomy or category ID if using custom walker?
- WP List Pages – Add Title Attributes to Anchors
- alternating classes on wp_list_pages
- How to get current pages menu text?
- Costum walker with sub menu item count
- How to include second layer sub menu to Walker Nav?
- How can I creat custom menu with bootstrap
- Can I now add a class in the anchor of my menu item with WordPress 5.4?
- Multi-Level Nav Bar
- Nav_walker add id to dropdown ul
- Change markup for just 2nd list element in custom Walker menu
- Menu walker: how to tell if a sub menu contains submenus?
- How to remove a sub-menu using walker hooks/filters without relying on a custom walker?
- Custom wordpress submenu
- Walker or wp_get_nav_menu_items VS jQuery
- WPML CMS Nav and Custom Nav_Walker Undefined Property Notices [closed]
- How to add odd and even classes to all nav links through walker?
- Output sort number in wp menu list item?
- Is it possible to separate all submenu items?
- Check in walker if current page is descendant
- Specific Page that convert Hyperlink to anchor in nav menu
- child comments not displaying as nested
- Customize Walker_nav_menu to show posts if item is category
- get_category_children/ the new get_term_children not work