Use do_shortcode().
For example, in a template, if you were wanting to display products specifically by ID:
<?php
echo do_shortcode('[products ids="1, 2, 3, 4, 5"]');
?>
WooCommerce comes with several shortcodes which can be used to insert
content inside posts and pages: http://docs.woothemes.com/document/woocommerce-shortcodes/You can add shortcodes to a post or page easily via the shortcode
shortcut button in the post editor:
Related Posts:
- Woocommerce Show Single Product on Homepage
- To close or not to close php
- WordPress and magic quotes
- How does printf( __( ) ); work?
- Return HTML Template Page with PHP Function
- Consuming an external API in WordPress?
- Reposition WooCommerce breadcrumb outside of wrapper content
- Why do templates contain so many PHP tag pairs?
- Is there a way to parse shortcodes in PHP?
- WordPress URL Rewrite not working
- What exactly does “Posts page” do in WordPress?
- Check if a menu is empty?
- WP E-commerce: Showing 3 random products from current category when viewing product
- Static Frontpage Pagination – Custom loop
- Get the php template file from other theme folder
- Woocommerce -How to set product regular price default
- WordPress Template Engine?
- How to have a custom display for both woocommerce archive and product-category pages? [closed]
- wp_remote_get returns an error for valid URL
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- On this day PHP code
- How to loop over custom fields in a page template?
- Blank on static home page?
- WordPress widget in custom theme
- WordPress theme & site not loading after moving files
- Adjust the results quantity for Search Results page pagination
- Bulk Image upload and one image for each post?
- Exclude pages with certain template from wp_list_pages
- Woocommerce price including tax with formatting from options
- How to display user nickname (not display name) in PHP template?
- Custom Template 404 for specific custom post type
- An unwanted inline style is added to my body tag
- How to properly insert a link to a template in WordPress?
- Custom field value not saving when it contains a URL?
- How to create a custom category of wordpress admin
- Adding a div at the bottom of a sidebar
- How to run JS, PHP and etc. inside WP post?
- Automatically add custom CSS to new posts using a category template
- Render ninja form inside markup
- How can I load a PHP page without using a Template?
- WP Post Template – Templates in own folder
- how could I load a different template part by page
- creating a second image attachment template?
- Mass update excerpt
- Working with wordpress plugin and theme templates structures
- WordPress: Access a plugin from within a theme
- WordPress plugin/code to hide all things related of a user from the public
- How can I get a single php file that is the equivalent of an existing WordPress page?
- Get and insert order email address to the PHP template inside HTML text
- Custom search results page not working with empty search
- I have a problem in the order of enqueues while enqueuing stylesheets and scripts for a specific page in my function.php
- How to show single category archive
- code is skipping a div
- Issues getting PHP to display in category pages
- Change title only in dynamic page
- Secondary navigation menu on one page
- Enable custom logo upload if logo is not in header
- Perform internal redirect in WordPress?
- Large Woocommerce Site (83,000 items), What Can I Do? [closed]
- How can I edit the content in index.php? [duplicate]
- showing 2 prices wholesale and normal
- How can I hide that I Use WordPress (with W3 Total Cache)
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- how to show only specific category for a template
- Show a different code on front page to other pages
- Does wordpress templates always in files or in database?
- WooCommerce Tabs [closed]
- WordPress add_rewrite_rules for custom URLs ending in .html
- Can’t print Yoast meta description into page template (syntax error, unexpected ‘.’) [closed]
- Using same variable names in files added with get_template_part()
- PHP include is only working in certain places in my custom WP theme
- Use WordPress function in php file
- Adding wrapper elements in the_date() like in the_title()?
- How to get all author posts outside of author templates
- Add filter multiple times using only one master function
- Create a Blog Template Page
- Showing latest post without 301 redirect
- WordPress template page name displayed on screen
- Is there a way to hook or call a custom woocomerce template that is not part of the default templates of woocommerce?
- single.php with different look by category
- How to call multiple functions from multiple files into a WordPress page template [closed]
- How to solve Woocommerce Memory Limit
- How do I define a lookup table that will work across all PHP elements of the template?
- Should i use the wordpress Options table or to create database table..?
- persist a variable set in header.php all the way down to footer.php
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Why doesn’t PhotoSmash plugin play well with wp_query?
- Removing WordPress Footer -without access to PHP code?
- How to set a template with wp_insert_post
- Why is a wp function used in current PHP namespace’s callback not resolved to global scope?
- Why does the Woocommerce grouped template prints the unpublished products?
- Adding conditional text to a PHP Shortcode Template
- Create page template via functions.php?
- what is %variable% in a wordpress plugin? [closed]
- How to make a Template page to show the information of different things Shop and Product page?
- How can one use variables in a template or template part without polluting the global scope?
- Need Help With Making Full-Width Template for Blog Posts (common methods aren’t working)
- How to edit templates created in the block editor in code / template files not updating
- WordPress post-template null warnings
- AJAX Appending Data Adds Mystery “0” :(