do_shortcode([espro-slider id=21]) will process the shortcode and return the result. The Codex describes exactly this example:
// Use shortcode in a PHP file (outside the post editor).
echo do_shortcode( '' );
You can often just call the callback directly also:
function generic_shortcode_callback($atts,$content) {
return "Yay! ".$content;
}
echo generic_shortcode_callback('',' Me!');
VS:
function generic_shortcode_callback($atts,$content) {
return "Yay! ".$content;
}
add_shortcode('yay','generic_shortcode_callback');
$sc = do_shortcode('[yay]Me[/yay]');
echo $sc;
Related Posts:
- WP_Query Pagination on single-custom.php
- Restrict custom post type to only site administrator role
- How to force one column layout on custom post type edit page?
- Make featured image required
- previous_post_link() and next_post_link() with a custom post type?
- Setting a custom sub-path for blog without using pages?
- WordPress REST Create Post of Custom Type
- Limit the post for differents custom post type in the same wp_query
- Custom Posts on Different Pages
- taxonomy list display custom post count
- Assigning a role to a specific custom post type (and ignoring other post types)
- Display posts in random post types
- Custom Post Type by user
- How to create posts (not post template) to be displayed on projects page?
- same archive template for different custom post
- Multiple Content Block
- Display Custom Post Type in Recent Posts
- IF statement in a do_shortcode
- Slug for standard post post_type
- Make `previous_post_link()` Function Show The Post After Next i.e. Jump A Post
- How do I create an archive page for standard posts?
- Take Variables Set in Functions.php and Echo Them Inside My Custom Post Template
- Remove parent from custom post type
- Remove All, Published and Trashed Post Views in Custom Post Type
- How can I show a custom post type for users in the authors.php file?
- Blog page showing same content as homepage
- Auto-generated posts not showing in backend (but being counted!)
- Need help targeting a custom post type with conditional tags
- How to add post_type=value when editing that post type in the WordPress admin?
- Open Custom Post Type as PDF
- Show the same Article Available in Other Categories
- Show custom post type filtered by category
- How do i calculate the total of values of custom fields in custom post types?
- Display random posts, but omit the post it is on?
- Get latest 3 posts from multiple CPT in one query
- Allow non-logged in users to see a future post after clicking on a list of future posts
- Meta query for custom post type ignored in main query
- Hiding posts by other users and non-logged in
- Update Post Meta for a logged in user
- Get related posts of child term of custom post type
- Get the category from custom post type
- Is it possible to store Custom Post Type data in separate set of tables and still have wp_post class functionality?
- Prioritize posts in query by meta keys?
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- Load Next Posts With AJAX not working with custom post type
- 2 Different Custom Post Types in Submenu
- How to assign classes to all elements?
- Reworking function for counting custom post type posts count
- Help With Warning on creating new Post types?
- help
- Including link to custom post type in ‘wp_list_pages’ function
- How to Display Posts From Category Within a Custom Taxonomy?
- Showing custom post type categories in the menu
- How to Make infinite loop of post
- WP_Query with custom post type ID
- Published post auto change status to pending after 90 days
- How to retrieve all wordpress posts (specific type) inside a function in php?
- Automatically update slug with latest title within custom post type [duplicate]
- Modifying the default post from wordpress
- How to Query in WordPress which shows Alphabetic Posts?
- Display post from custom post type
- Custom post type title of each author in his own post
- Does “Custom Post Type” can have page hierarhy option?
- How set template for “custom post type” individual post
- A sports wordpress website
- Custom Posttype URL
- Display custom post front end filter by ACF equals current user
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Settings -> Reading -> Posts Page ->Blog — is not working in my website
- Is it possible to get the specific content on the search page?
- How to mass get post editor URLs
- How to create additional rendering for custom post types?
- SELECT custom post type and its meta in SQL
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- How do I insert a custom post type query after a certain number of recent posts and then resume recent posts?
- How to create editable sections in wordpress?
- Instructor can view, edit, delete only theirs courses
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- Assign for all post of a post type a specific single-post template
- Custom Post By Category
- Widget area for individual posts (custom post type)?
- Change Custom Post Type to Post + Category
- update a posts of other custom post type
- Get post from Category by Priority
- Show custom post type under last posts configuration
- Custom Post Type used for FAQs Accordion
- How to Associate Posts with Pages
- delete custom post type using a submit form
- Custom Post Type children and grand-children in one list
- Why are my wp urls showing page not found?
- Post content stays the same but permalink changes ?
- Can I set a CPT title field to a dropdown with preset options if user is of a given type?
- Styling first post using Advanced Custom Fields
- How do I display the index position of a post from a custom post type?
- Two pagination in one page without AJAX
- Passing total post count to javascript
- Display posts of only a certain category in WP Admin section?
- WP_Query for multiple post types just shows one
- Display the progress of post achievement with percentage against target in wordpress dashboard