I think your “do_shortcode” is not parsing the variable.
Try with this code:
echo do_shortcode('[datatable id=30 var1="'.$idnr.'"]');
* Note the ‘ before and after the .
Related Posts:
- Shortcode outputs at the top of the_content
- Combining shortcode and get_template_part
- Escaping quotes from shortcode attributes
- Shortcode output always showing at top of page
- How to detect if a Shortcode is being called on a page?
- How to get current page title inside a page itself in a shortcode and in page content
- Short code to display a loop
- shortcode inside another shortcode
- How can I just get content inside a shortcode or just outside
- Need MySQL Query or WP-CLI command to updates old URLs in Shortcodes [closed]
- Custom Shortcode AJAX 400 Bad Request
- WordPress core responsive video not working with shortcode
- shortcode to create dynamic dropdown box form shortcode attributes
- conditional shortcode not working
- How do I add my own custom shortcodes?
- Can’t seem to get [shortcode]s to work
- Wraping $content into link with shortcodes
- nested Shortcode doesn’t work
- Simple contact form with field validation
- Slow page loading when using a simple shortcode on the same page multiple times
- TinyMCE get selected text and underlying HTML
- Remove and restore one shortcode
- Rewriting WordPress Gallery Shortcode with Bootstrap Carousel
- other shortcodes in Contact form 7 MAILS [closed]
- Remove empty p-Tags in Shortcode content before non p-Tags
- What is a short code?
- Wrap shortcode inside custom block
- Instagram URL is converted into oEmbed
- Shortcode with no attribute but has value
- Remove wpautop from specific shortcodes only
- Creating a shortcode based on users preferences
- Get a post’s thumbnail url or display default image in shortcode
- basic shortcode – Why 1st paragraph not wrapped in p tag, but 2nd is
- unwanted P tags in shortcode, delay wpautop not working
- Shortcodes and a list of IDs?
- Shortcode adding plugin output before post, instead of inline [duplicate]
- Convert HTML Script to Shortcode [closed]
- Registration Form Shortcode
- Include tags in the body of a post
- no content after shortcode
- Shortcode to show current post category with link
- Gutenberg Block with Select from JSON-File
- How to register a user via modal after clicking a link in the shortcode?
- add widget to page content (using shortcode)
- WordPress TinyMCE : Get value of popup button
- Freeze a shortcode in place?
- Unable to the get the gallery inserted between shortcodes
- Complex Slider Shortcode Help
- Using _e() on text inside video tags prints that text, instead of only showing when html5 element is not supported
- Youtube shortcode
- Shortcode will not pass attribute through to my function [duplicate]
- Displaying audio player as preview in audio post in WP3.6
- How to edit blog page in wordpress? there is no place to put shortcode
- How to transform WordPress user role code to WP shortcode?
- Can I use shortcodes in mail body
- Does short-code slow down my WordPress site?
- redirect if shortcode exists
- Position shortcode off [duplicate]
- Shortcode Help Needed → attributes
- Video Shortcode & Video Poster Question
- How to use a nested shortcode to render the value of an attribute in parent shortcode
- ob_get_clean(); doesn’t return $value in shortcode?
- Ordering get_terms with ACF not displaying all terms
- Which wordpress function is the caption shortcode linked to?
- Content between shortcodes
- Parsing a shortcode through an author meta textfield
- Adding YouTube button to TinyMCE editor
- How to find out what handler is registered to a shortcode
- Shortcode strips formatting and returns at content top
- do_shortcode within a shortcode
- tiny_mce_before_init preventing custom shortcode icon appearing
- Custom Fields – Boolean Display of True/False to Yes/No
- How to display NextGEN gallery in templates?
- Twitter bootstrap tabs
- jQuery Tabs in Shortcode API
- Using Shorcodes in Sharing Preview and Notifications Title from Post Title
- Echo Extra Shortcode HTML to wp_foot
- How can I use a plugin shortcode inside of a html form?
- Disable wpautop on Shortcode attributes
- remove shortcode pagination for specific url referrer
- If statement shortcode
- Shortcode PHP file for two conditions passed when do shortcode
- update_metadata() appends shortcode data for every page refresh
- Gallery shortcode is empty but magically creates a gallery
- Add audio file to post using custom term meta field as link [closed]
- Display tags cloud from a specific category ID with a shortcode
- 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?
- Shortcode appeared twice on page, one time before content, one time where it’s really called
- How to list child pages with excerpts, e.g. [child-pages depth=”1″ excerpt=”1″]
- Get current category and place it in shortcode
- Video shortcode outside WordPress not working with IE and mediaelement’s Flash fallback
- Inserting a variable into a shortcode inside php
- Using shortcodes that wrap around code
- Shortcode for Admin Theme Option?
- Clarify: Enqueueing scripts within shortcode only loads in footer?
- What makes a placeholder resizable in Tinymce?
- Create plugin/function to catch XML-data via Shortcode
- Shortcode conversion to hrml when post is published
- Why does my shortcode query not working with search term
- How to use multiple values in “Shortcode”? [closed]