Thanks to @kero I have implemented this code:
<?php echo do_shortcode('[responsivevoice voice="Italian Female" buttontext="Ascolta"]'.'<br>'.$bodyContent.'[/responsivevoice]'); ?>
The $bodyContent variable contains the HTML value of the article’s body, obtained using this function: http://www.web-templates.nu/2008/08/31/get_the_content-with-formatting/index.html
<?php $bodyContent = get_the_content_with_formatting(); ?>
Related Posts:
- Adding short codes from a page’s content on header and hiding the same from page’s content
- Error do_shortcode In WooCommerce Template
- Print shortcode in defined area
- Adding a template part as part of a shortcode
- When are Shortcode Attributes Available in Template
- Getting Shortcode Attributes befor content is displayed by the template
- my form does not insert any data in the database
- Use atributes of shortcode in get template part
- Shortcode or Template Page
- Using shortcodes that wrap around code
- Create a shortcode to display the “the_content ()” in my post [closed]
- wp:shortcode works in block theme template file but not PHP include file
- Conditionally Loading JavaScript/CSS for Shortcodes
- How to create a shortcode with 1 parameter (atts)
- Return HTML Template Page with PHP Function
- shortcodes output before content [duplicate]
- WordPress adds br in between my shortcode
- Shortcodes, HTML tables, and multiple rows
- WP_enqueue_script inside shortcode?
- Shortcode to Gutenberg-block: additional text on front-end and conditional display
- How navigation works in custom loop within shortcode?
- Use [shortcode=”value”] instead of [shortcode att=”value”]?
- I dont want to show shortcode in tag
- Post loop created via shortcode not displaying shortcode in content
- Pass shortcode variables to template
- Shortcodes: Pros and Cons
- esc_attr not working in shortcode
- WordPress shortcode doesn’t working on HomePage
- Can’t understand $atts in functions?
- Are .MP3 files with capital letter extensions allowed in [audio] shortcode?
- Add attribute to shortcode dynamically
- Execute shortcode twice in the same page
- How to parse this shortcode?
- Get Posts shortcode plugin and meta_query?
- Add custom setting that uses radio button to WP Gallery
- Shortcode with hyphen doesn’t work
- Shortcode parsed incorrectly because of heredoc
- Shortcode “post_per_page” not working
- Shortcode is running in page editor
- Creating shortcode with parameter
- Video Shortcodes not working in WordPress
- Custom shortcode is not working in text widget
- Shortcodes won’t work on live environment
- Create shortcode in Child Theme?
- Get post object in shortcode function
- How to insert image and text from admin panel throughout my theme
- Create a short code to display a specific loop
- Use shortcodes in terms description? [closed]
- Adding to the_content or a variable from within a shortcode function
- How to add shortcode to HTML file (not showing on website)
- Custom Shortcode: define cursor position/insertion point?
- How to use the same shortcode with different attribute values on same page
- WordPress messes up with data attributes in shortcode output
- Displaying audio player as preview in audio post in WP3.6
- WordPress post pagination continuous [duplicate]
- custom field value as shortcode parameter
- Shortcode don’t work in custom option field, any solution?
- Slow page Loads When Using Dynamic Coding
- Can I use shortcodes in mail body
- Position shortcode off [duplicate]
- Query to list all galleries under a parent post?
- Adding the username into a URL to redirect to a specific page
- Shortcode Help Needed → attributes
- Video Shortcode & Video Poster Question
- Ordering get_terms with ACF not displaying all terms
- How to Get Shortcode in Excerpt to follow Document Flow
- Cant fix this Warning: Invalid argument supplied for foreach() in [closed]
- Different ID in every shortcode
- Unique ID for WordPress shortcodes when used more than once on a page?
- Which wordpress function is the caption shortcode linked to?
- How to find out what handler is registered to a shortcode
- How to display NextGEN gallery in templates?
- Build Clickable Link Using Multiple Attributes
- Using Shorcodes in Sharing Preview and Notifications Title from Post Title
- Is the WP audio shortcode still relevant?
- Third-Party API – PHP Fatal Errors Paired with http_request_failed / cURL error 28
- If statement shortcode
- Using within a shortcode
- Shortcode not working when I output data from wpdb html table row
- How do I point bloginfo(‘stylesheet_directory’) to my parent theme?
- Gallery shortcode is empty but magically creates a gallery
- How to avoid one code multiple times instead do that through some function? Shortcode, but I think shortcode is not used in main theme’s core files?
- How to list child pages with excerpts, e.g. [child-pages depth=”1″ excerpt=”1″]
- Add a shortcode in woo-function.php
- Get current category and place it in shortcode
- Woocommerce products shortcode specific order
- Modify Blog Module layout in Child theme
- Video shortcode outside WordPress not working with IE and mediaelement’s Flash fallback
- Display title of child pages in shortcode
- Output html source tags inside shortcode
- How can I define the output of shortcode attribute value?
- Shortcode for Admin Theme Option?
- What is the best way to include a template file within a shortcode?
- What makes a placeholder resizable in Tinymce?
- Shortcode templates
- Enclosing shortcodes create line breaks
- Add the results of a custom query into a do_shortcode
- Free Add to Cart Button on WooCommerce with Elementor – No Premium [closed]
- wordpress shortcode url decode non Latin character
- How do I create a shortcode that returns a logged in users’ email?