Quite simply put: there is no built in function that does the same thing as your code above.
Bonus content: More tag tricks
Related Posts:
- How to move the the_excerpt’s read more link to another div
- Exclude read more in the_excerpt [closed]
- Read more doesnt work with query posts
- after_setup_theme always runs
- WordPress API Menu/Submenu Order
- Child Theme vs Duplicate Theme Renamed
- How to move page templates to custom folder?
- Setting multiple default background images?
- How to make a theme with more than one CSS file?
- Is it feasible to build and update a WordPress website offline?
- First wordpress blog, should I make my own theme for maximum customizability?
- How do I hide tags that have only been used once?
- Translated strings not appearing – what am I missing?
- Can I upload WordPress-react theme in Wp theme repository
- the_excerpt() not showing manual excerpt for Pages
- WooCommerce: VAT on grouped products
- Why is unfiltered html allowed in custom fields for author / contributor roles?
- Select front page and blog page in custom theme settings page
- What are the Theme tags in style.css used for?
- How do I locally enqeue the mediaelement.js file into a wordpress theme
- Version control for both Vagrant config and themes being developed [closed]
- Avoid theme updates, just one theme
- Theme change only in CSS and a few images
- wp_editor() usage in custom meta box
- Is there an action for save_menu and/or update_menu?
- Does a premium / for sale theme need to go through the WordPress approval process?
- Metadata Query when storing data as array possible?
- Excluding Pages not working
- filter out “uncategorized” from all category listings with one filter in functions.php?
- How to use different assets if local or live
- get_option() returning empty
- How can I add a custom button to the post editor toolbar?
- How to make the excerpt_more filter apply to the actual post excerpt?
- How to add a user defined hyperlink to the “Featured Image” and the_post_thumbnail()
- Using PIE CSS in WordPress. “localizing” styles
- Category specific themes?
- Default image size not working
- Change locale by detecting viewer’s browser language setting and let them choose prefered language after
- Why is it needed to enqueue parent stylesheet in child theme?
- Limit number of users a role can create
- Changing Header Image Every N Minutes/Seconds
- Change WordPress header color using customizer
- Default Text not showing from customizer
- Can I add an icon & function to the “Upload/Insert” toolbar at the top of the content editor?
- underscores use of the article element on the page template
- Ideal inline dynamic CSS injection
- How to create and populate with few links a menu in child theme functions.php?
- Plugin does not work in custom theme
- How to Manually Code Shortcode?
- Making custom woo themes
- Where does the uploaded image go?
- Remove link on full-size images
- How to reset post data properly
- Previous and Next links not populating, have I missed something?
- get_search_query() not working with search queries with ampersand in it
- Single.php the_excerpt loads same as the_content not loading read more line
- Where to put custom page templates in theme?
- If user is logged in and has a role echo statement
- Is there a way to retrieve the calling template part?
- How to fix WordPress images not showing up in local hosted XAMPP server?
- Let user to add input fields on theme option page
- .current_page_ancestor broken in Twenty Eleven
- MapPress Easy Google Map in Jquery Tabs Problem
- Homepage slider not using correct images
- WordPress Show Single Post on Home Page with previous/ Next Button
- How to change listing type permlink?
- Calling a WP Plugin Function’s Variable in Theme Template [duplicate]
- WordPress theme header.php should I add title meta?
- Help with Core Mods
- Problems with cart and pages on _s theme
- Local variable name in setup_postdata()
- Creating a Single Page Theme correctly
- Custom post type query with pagination doesn’t work
- Fatal error: Class WP_Customize_Image_Control not found
- Child theme menu not appearing in Twenty Seventeen
- Edit Product Archive design for Woo theme
- How do I remove header/page-title image in farvis theme? [closed]
- how to edit woocommerce checkout page
- Which theme PHP file should be edited in order to change Posts appearance
- Necessary css classes to be included in theme stylesheet
- How to link post image to post link?
- How to hide blog by id wordpress multisite listing
- Get chronological page order
- jQuery conflict in WordPress, works fine in HTML
- Including some variables in function.php and echo them is several place of theme is not working
- How to override wordpress native options with theme options
- Why is including all your files within a theme folder important?
- FitVid not working for iframes on particular theme install
- Problem with multiple menus in theme
- How to create multiple sidebar areas with a forloop and register_sidebars?
- Make theme editor to show all theme’s files
- Saving Permalinks Results in 403 MAMP (Windows)
- Add rel to all images in a post
- add_action works outside condition but not inside it
- Bootstrap isn’t called into my WordPress theme
- Jquery Ui Tabs not working
- Adding a new layout for genesis
- Which function(s) to build a paged HTML table
- white spaces on the all sides [closed]
- What is the point of using archive.php instead of index.php?