0
votes
1answer
32 views

How to extract the variables out from “add_shortcode” function?

In Wordpress, lets say i have a custom Shortcode function, like: function foobar_func( $atts ){ //whatever required processings here... $foo = "the value is foo!"; $bar = "the value is ...
-1
votes
1answer
29 views

How to read a page's “Shortcodes” from the Template File?

Lets say i have a Page, and it contains some shortcodes like: [myshortcode foo="bar" bar="bing"] [anothershortcode foo="bing" bing="bar"] Then how do i read those from my custom Template File, to ...
0
votes
1answer
34 views

Shortcode to output get_header not working

I'm trying to create a shortcode that will output the contents of one of my template header files. I created the shortcode in my functions.php file function zoo_header(){ return ...
0
votes
0answers
60 views

Most elegant way to create html for shortcodes?

Shortcodes seems to be very nice way to introduce complex features to the content blocks, but I don't like to generate html inside shortcode function. Instead I would like to create template file for ...
0
votes
2answers
77 views

Shortcode / plugin with custom (flexible) output

Following scenario: I'm building a theme framework which I want to reuse in various themes of mine. In this framework there is a collection of many shortcodes. For exemplary illustration of my ...
1
vote
2answers
1k views

Return HTML Template Page with PHP Function

I want to create a form that I can use a shortcode to insert into my site. It would be really nice if I could create the HTML part in a seperate file and then insert it with a PHP shortcode (to ...
2
votes
2answers
757 views

Adding short codes from a page's content on header and hiding the same from page's content

I have created a page and added the following shortcode from wp-orbit-slider [orbit-slider category="test"] I want the contents of [orbit-slider category="test"] be displayed on the header ...
-1
votes
1answer
289 views

Display HTML5 jQuery Audio Player On Front Page

I would like to display the plugin HTML5 jQuery Audio Player 'centered' on the front page of my site. The plugin comes with shortcodes for posts and pages but my front(home page) only works with the ...
0
votes
2answers
128 views

Using locate-template & shortcodes doesn't appear to work

For organisation, I'm trying to split up the functions.php file into separate files. In particular the functions for shortcodes in a separate file, with the shortcodes being defined in functions.php. ...
1
vote
1answer
151 views

How to format shortcode's HTML in external file

I need to add a shortcode in my theme and I would like to put the HTML code not in the function which creates the shortcode but in a template file in my theme directory. Now I have function ...
1
vote
2answers
415 views

do_shortcode() doesn't work if shortcode contained in variable, works if shortcode passed as string

I'm developing a plugin, wherein one of the features is to switch out forms on a specific page by changing the shortcode within a custom field. within my plugin file: function getShort() { ...
3
votes
4answers
3k views

How to check if a shortcode exists?

I'm using do_shortcode function to add shortcode in my template. But i would like to check if that shortcode exists before display them. I mean like this If (shortcode_gallery_exists) { echo ...
0
votes
1answer
3k views

how can I add a “read more” tag directly in the template?

how can I add a <--more--> tag directly in the template? I mean, the exact php code to use in a template for that shortcode. I need it for a script that makes use of that shortcode to hide content ...
0
votes
1answer
209 views

Trying to display short code content in template file with do_shortcode()

I installed the WP Issuu plugin on a site and tried to use do_shortcode() to render the shortcode in the template file. Strangely it doesn't work, although it does for the [gallery] shortcode. I.e. ...
0
votes
2answers
374 views

Shortcode in pages or tempate files for custom post type

I am using WordPress to develop a coupon site. Merchant pages are somewhat similar to this. I am using shortcodes in these pages for Facebook Like, Google +1, Customer Review, Codes from similar ...
4
votes
1answer
1k views

Is there a way to parse shortcodes in PHP?

Many plugins don't provide a documented way to access their functions from within PHP (e.g. when building a custom theme), but only shortcodes to insert in posts. Is there a standard way of executing ...
2
votes
1answer
1k views

Why does my short code get executed before other content?

I have the following text in a page. As you can see my shortcode is right at the bottom but somehow when the code runs, the out put of my shortcode is inserted at the top of the page instead of ...
0
votes
2answers
1k views

Wordpress Shortcode wrap around div

Is there a way to wrap a wordpress shortcode around a div in a template file? Here is my code: <div id="subscription"> <?php do_shortcode('[subscribe]');?> <p>This is subscription ...
0
votes
1answer
651 views

Stream Video Player does not work with do_shortcode()?

I have downloaded a plugin called Stream Video Player, which has a shortcode. If I put the shortcode into the content editor, it works well and it displays the video. However, if, inside a template I ...
0
votes
1answer
185 views

How to make post templates to include shortcodes only?

I used to post same shortcodes every time (shortcodes loads dynamic contents). So, I want to pack these shortcodes in a template for my posts. How can I do this?
0
votes
1answer
673 views

Using shortcode in template file

this is shortcode in template: function shortcode_frame_left( $atts, $content = null) { return '<span class="frame alignleft">'. do_shortcode($content) . '</span>'; } ...