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
- Using get_posts vs. WP_Query
- How to Access Global $multipage or Global $numpages outside the loop?
- Merging a complex query with post_rewind and splitting posts into two columns
- ‘posts_where’ filter not applying ‘WP_Query’ in `wp_ajax`
- Filter wp_query to search post title in function
- Setup of taxonomy term template pages
- how to get the id for a post from within a post and return post meta for it
- WP_Query’s “request” SQL Query
- Order taxonomy terms in alphabetical order
- is_search was called incorrectly
- How do I sort posts with multiple pages
- How to set pagination to work with ‘/page/’?
- How to do meta_query for attachments?
- Most commented last 24h, week, month, year and all time – posts_where
- How to duplicate 5 posts out of WP_Query results?
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Dynamic User Id
- Hide elements outside loop based on query
- Combine 2 WP_queries into one (OR relation)
- How to add sort order to incremented and paginated category loop
- Get posts with no tags?
- get_posts query matches too many results
- Sort by custom field that is an array?
- Which is from this queries is more faster
- Start Query from 2nd Post without offset
- Trying to change category of wp_query
- Any quicker alternative for WP_Query “NOT IN”
- duplicated posts when using pagination
- meta_query order by date present -> future then show null
- In a WordPress multisite configuration, how do I instruct WP_Query() to return posts from a sub-site?
- How to query for exact string in custom field?
- Multi line of $wpdb->query just run 1 time and end the loop right after
- Paginated Author.php not using Author.php template
- A very strange problem with search query
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Custom Theme Building & Permalinks
- wp_query – show pages that have parent defined
- previous_posts_link not working in WordPress pagination
- Eliminate typical pages on search page, turn it into ajax search with “infinite” sized single page
- Display First posts without the default featured image
- paginate_links() with Custom Taxonomy
- Parsing External Table Arguments
- Query posts by meta value and sort by another meta key
- Output ACF field dynamicaly within a taxonomy loop [closed]
- Trying to create shortcode listing custom posts, but formating not being included
- Why does WP_Query not search for two ‘meta_query’ keys separated with OR?
- How do I split a large query with a semi-expensive function included into multiple smaller queries
- Custom WP_query in Jnews theme returns thousands of posts