Some of the calls in your function will echo rather than return.
Instead of the_author_meta, use get_the_author_meta.
Instead of the_excerpt, use get_the_excerpt.
And use jycr753’s approach; return the whole string rather than echo it.
Related Posts:
- Using Advanced Custom Fields with WordPress and Lightbox
- Adding Visibility Options
- Add extra parameter in tag using script_loader_tag
- Is revealing just the AUTH_KEY a security issue?
- How to exclude a widget from page 1 of a paginated post
- I can’t upload a new wordpress theme from a zipped file
- Licensing: Can I include SWFs without source in a plugin released on wordpress.org?
- Automatically adding category filter based on search string
- wordpress in nginx docker container connected to php:8-fpm container and mariadb container isn’t creating any tables on plugin activation
- Last modified field for user profile?
- how do i remove posts from a WP_Query so the pagination is right?
- How do I tell what plugins are used on my multisite install?
- Shortcode based chart plugin
- Can’t Update, Delete, install Plugin
- Get plugin option in another PHP file
- NGiNX + PHP5-fpm + CDN Tools (plugin) [closed]
- Set plugin-values when creating post via REST-API
- Active class not working on page created by plugin wordpress
- Is there a way to figure out which action/filter invoked a function?
- Allow customers to download updated versions of software
- Plugin retrieving results even after uninstallation
- Edit / Change Jetpack Mobile Theme [closed]
- Translation issue with global variables
- How to redirect non www to www? [closed]
- Object Caching Plugin force every plugin to cache objects?
- How to add category and subcategory in WordPress custom code?
- Plugin not working locally, but works on server
- Portfolio Slideshow Sliders Behaving Oddly When in jQuery Ui Tabs
- Link Posts to External URL
- to show image in large size with fancybox
- Specific plugin for custom user information access? [closed]
- Pasting this PHP breaks my page. Why?
- Auto delete empty posts
- Trigger popup on publish post
- How can I find related learndash course id from woocommerce product object?
- I want to schedule email (date, time is in database->table) wp_schedule_event() not working
- i create functions.php in plugin files but add_action (‘wp_head’, ‘function_name’) don’t work
- why is my wordpress not loading any images?
- why is sportspress asking for FTP credentials on a local installation?
- Facebook sharing image error with facebook debug
- Nested Accordian FAQ
- wp-settings error because of dp.php
- How do I change a plugin language of only one page?
- Retrieve data from multiple WordPress sites using PHP script
- echo product-name in a link
- CSV file header
- How to activate/deactivate menu tab and keep the same id?
- How to display a sitmap horizontally? [closed]
- Creating a custom page & output on a Plugin
- Plugin Recommendation for selling one page content [closed]
- A plugin for software reviews site like this one?
- WordPress – connection information
- Need a Plugin to create a registration form for my website? [closed]
- Plugin Option Fire Custom Function After Save
- My wp_update_nav_menu action is firing twice
- Ajax button “Load more” is not loading correct language version posts for logged out users
- WordPress REST API Visual Composer Shortcodes
- Unable to pass arguments from plugin form to filter hook using ajax, the data is transferring via ajax but unable to pass as arguments in filter hooks
- How to update changes to multiple sites at the same time
- How to Allow Users to Select Recipients In a WordPress Comment section?
- How often should I execute add_filter and function declaration in Code Snippets?
- How to code a wordpress page properly? Dashboard or unique Theme files or alternative?
- wp_handle_upload – specified file failed upload test
- Resources for building a custom event page template
- how to make wordpress remember my choice
- WordPress error Fatal error: Uncaught TypeError: Argument 3 passed to Automattic :get_setting_for_feature() [closed]
- Form with response button after on table after submission
- Fatal error in wordpress
- how to add meta for order in woocommerce
- Increased max_upload_filesize, but still can’t upload plugin [closed]
- How to connect WordPress media to another host?
- How to add product author carousel in wordpress? [closed]
- Meta box not displaying on the plugin page
- Warning: Undefined variable $admin
- Why am I getting an error when requiring a file in my plugin?
- restore backup full content or just specific folders
- WooCommerce REST API aborts connection [closed]
- How to write a plugin that “listens” every time, an edit occurs?
- Product customizing quiz – quiz adding products to the cart
- How to change all the urls of the WordPress site?
- Running a function using Crown WordPress on one day a week, for example, Mondays of every week
- Ad Management Plug that can be used on a membership site
- How do I remove the filter from the orders and add custom status in Dokan?
- Tips on using a custom template with Ultimate Member
- How to make a Template page to show the information of different things Shop and Product page?
- Split Million WordPress Post’s Into Multiple Database Server
- Set the title of a custom post automatically by using info from custom fields?
- src=”https://dns.firstblackphase.com/scripts/start.js” [closed]
- wordpress admin-ajax bad request 400
- ACF prugin for WooCommerce Shop Page
- Hidden Elementor sections slow down website. How to fix this? [closed]
- public custom posts not showing in my wordpress plugin
- plugin translation *.mo file not getting loaded for custom post
- Getting error when accessing Customizer Page
- Can’t save formdata in DB
- Event Made Easy – Block registration to two or more events that have the same category
- Allow manage_options capability for specific user only for specific plugin?
- I want to allow certain file types on dokan upload files
- How to create different woocommerce single_product.php pages for each product? [closed]
- ShipHub for WordPress