do_shortcode() returns the content you pass it with the shortcodes, if any, filtered out (ie, processed).
So the code you’ve posted in your question won’t work the way you want it to:
do_shortcode( get_the_title() );
printf(
'<h2><a href="%s" title="%s">%s</a></h2>',
get_permalink(),
the_title_attribute( 'echo=0' ),
get_the_title()
);
Instead you’ll need to do something more like this:
$title = do_shortcode( get_the_title() );
printf(
'<h2><a href="%s" title="%s">%s</a></h2>',
get_permalink(),
the_title_attribute( 'echo=0' ),
$title
);
or
printf(
'<h2><a href="%s" title="%s">%s</a></h2>',
get_permalink(),
the_title_attribute( 'echo=0' ),
do_shortcode( get_the_title() )
);
Related Posts:
- How to paginate wordpress [gallery] shortcode?
- What kind of object type is WP_Query?
- Last post ordered by publish date using WP_Query on front page
- Shortcode returns escaped HTML tags
- WP_Query in a shortcode
- posts order by title second word
- ‘&’ causes an error in my shortcode when I list the content of the page
- Can certain (site-crashing) limitations on WP_Query in shortcode be overcome?
- How to retrieve current page WP_Query arguments?
- wp_query add arguments using array_push if variable met
- Category attribute not working in custom shortcode
- How to get all child pages in their parent page?
- Database Queries Optimization with new WP_Query
- Orderby is working with one query but not with other
- Shortcode for latest -not expired- posts
- Gallery shortcode numerical sorting
- How to output the title of the blogs home page
- How to filter a query by date in a shortcode?
- How should I approach changing the template & $query as part of a shortcode’s execution?
- Shortcode for custom query not returning results when attributes are added
- How to Display Shortcode in the correct location, currently displaying before content after Page Title?
- WP_query only displays one of my custom post type entries
- Assign a minimum result count for WooCommerce query shortcodes?
- Use title of post as argument for query
- Using a Shortcode to List Posts from Multiple Categories
- embedding shortcodes in php template
- How to get specific string in explode array?
- Trouble passing attribute into shortcode function
- Woocommerce Shortcode which displays a table with product data
- WP Query by 4 different taxonomies
- create custom shortcode wp and put php code in
- How to display a post(by id) along with css in a page?
- How to search posts by title with special characters in WP_Query?
- Shortcode attributes causes 500 error after updating the page
- pages shortcode filtering by category
- WP_Query & shortcode : Return 3 articles from a category WordPress
- Query by Category and Custom Field – Shortcode
- How to take parameters from a function and make them editable as attributes in a shortcode
- How to modify WP Query to target the first most recent post to adjust content
- Object of class WP_Query could not be converted to int inside shortcode
- How can I create another instance of my custom shortcode
- Get Current CPT taxonomy category in shortcode
- Custom shortcode not displaying categories and correct date
- return wp query results in a shortcode
- More efficient query to display posts in same sub-category?
- Having Trouble Running Query From Shortcode Using Tribe’s Events Plugin
- shortcode using multiple WP_Query’s with multiple category names not fully functional
- Shortcode does not display pagination [duplicate]
- How to write a query-function as a query-shortcode?
- shortcode with $atts with strange results
- WP_query shortcode inside acf Repeater breaks the repeater loop
- How to prevent WP query searching in executed shortcodes
- How to create a three column blog layout with a single query and with three different classes?
- get data match with extra field value using wp_query for custom post
- Custom query: Get all posts that are from a certain category?
- Transient api Caches confused
- Append URL query to next post link in custom query
- How to compare a date in custom field with today’s date in custom WP_Query?
- Meta Query doesn’t works as espected
- Query Posts by Tag and exclude
- wp_query is showing posts from other categories
- Multiple wordpress queries with nested output (odd – even)
- it’s possible make a WP_Query with math operations?
- show posts with range meta key
- how to write wordpress query for multiple metakeys checking?
- How to display a list of posts in same child category as current post
- wp_query on page template not working (Genesis framework)
- Display post meta conditionally based on it’s value
- How can i show pagenavi in my author.php?
- Randomly select one of last 3 posts
- Using WP_Query with multiple loops on one page in search.php
- WP_Query Pagination
- Order by post meta not working with pre_get_posts filter
- is_user_logged_in not working from WP-API (wp-json)
- ACF: How can I publish values of ACF fields in a loop while using wp_query?
- Sort by price wpdb
- WP_Query random ordering not working since 5.4
- Show a message if there are no active posts in category
- Where my home page and font options has gone?
- How to get the latest post list (of the parent custom custom type)
- Problem with my loops
- 404 page on custom search pagination
- next_posts_link not visible on first page
- Query string order by custom field
- Paging works correctly on local version, but not live?
- Create global array to compare inside a query
- Hi , i am trying to set the post for 24 hours and with it will be changed
- Own query vars are not displayed
- Show full category tree for a year with all post titles?
- Trying to use “Medium” featured image for custom post type on home page
- Filter posts/pages by user_role array
- Display images with same specific value?
- WP_Query with meta_value_num and meta_query not paged correctly
- I need value of saved meta to display next to the post it is associated with
- Search Query that Includes Custom Table
- Pagination with WP_Query not working
- How return normal search result using wp_ajax action for wordpress
- Custom post types loop on a page template
- How do I have multiple metaqueries inside one wordpress query
- Can I use WP_Query to find a post with a particular menu_order?