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
- How does printf( __( ) ); work?
- Return HTML Template Page with PHP Function
- Consuming an external API in WordPress?
- Why do templates contain so many PHP tag pairs?
- Is there a way to parse shortcodes in PHP?
- Static Frontpage Pagination – Custom loop
- Get the php template file from other theme folder
- 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?
- WordPress widget in custom theme
- Bulk Image upload and one image for each post?
- Use Timber/Twig to pull an image by image ID [closed]
- Unable to set right time in admin and frontend template
- Easiest way to show total number of subpages
- woocommerce and is_user_logged_in() if not redirect to homepage
- Woocommerce Custom CSV export
- Blank space at beginning of tag?
- Link to file in plugin directory from wordpress template?
- Password protecting content in custom template
- Add a Second Menu to a theme that only support 1 menu
- WP_cron won’t trigger my action
- Inject PHP code into “sidebar-content” – code before my WooCommerce sidebar widget?
- How to display user nickname (not display name) in PHP template?
- Custom Template 404 for specific custom post type
- How to properly insert a link to a template in WordPress?
- Custom field value not saving when it contains a URL?
- Adding a div at the bottom of a sidebar
- Render ninja form inside markup
- 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?
- 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
- 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
- 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
- Show a different code on front page to other pages
- Can’t print Yoast meta description into page template (syntax error, unexpected ‘.’) [closed]
- PHP include is only working in certain places in my custom WP theme
- Use WordPress function in php file
- How to get all author posts outside of author templates
- Add filter multiple times using only one master function
- How to solve Woocommerce Memory Limit
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- 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?
- Create page template via functions.php?
- What’s a good way to allow overwriting files within a child theme if I want the same folder structure?
- how to display this functions?
- is_page_template showing partial results
- Adding regular php file to site
- Override Admin menu icon
- Post repeated when opening in overlay, how do I solve this? [closed]
- How to suppress template-parts in undescores?
- Creating custom page template from existing PHP site
- Conditional string comparison failing for basename/slug
- How to add new CSS file to new PHP file
- pass html code to worpdress
- feedburner plugin for WP 3.5
- Display additional page templates and a sidebar on plugin activation
- Getting a WordPress tag to print inside of a traditional php echo
- Prevent header and footer from loading on specific pages with template or plugin
- Integrate admin plugin into template. Very interesant (live search + autocomplete with wp rest api, in vanilla js)
- Display metabox galleries on specific page template in admin editor
- Display WordPress archive template page in 3 columns and not 1 column [closed]
- Run do_shortcode on php template using JS function
- How to hardcode header and footer in WP?
- Polylang and template files
- Change Jobs for WordPress templates
- How to create dynamic templates?
- If is_page elseif is_page not working like I want it to
- Change WooCommerce template for PDF – access to custom field
- missing admin bar and widget in a template
- How to include a function in a template with template tag
- My own theme’s custom widget areas are not working
- How do I modify the Previous and Next Page posts on blog pages to include “previous” and “next” before the links?
- How to call a certain object/menubar in a PHP file
- WordPress plugin creating sidebar on the theme/page
- Problems With Query and/or Template Part and/or PHP
- How to get WordPress Adminmenu items?
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- why is markup routinely placed in functions in wordpress?
- Odd page behaviour after removing sidebar
- WordPress Plugin Receive a Link
- WordPress: Create A Widget to Accompany Plugin
- How to refresh a template page on WordPress in 3 seconds – easiest method?
- How to implement a custom sliding banner? [closed]
- 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
