BB-Code-like mechanism by which strings enclosed in square brackets can serve as shorthand for longer and more complicated strings. These strings are processed by callback handlers, usually on page load, which replace the bracket enclosed string with the output from the callback handler.

learn more… | top users | synonyms (2)

2
votes
3answers
560 views

get attributes/part of the gallery shortcode

I'm trying to grab all image id's that are associated with the [gallery] shortcode that are listed as exclude. For example: if my post has [gallery exclude="1,2,3"] I'd like to get a variable that ...
0
votes
2answers
712 views

Does Wordpress support a shortcode calling itself from within a shortcode call?

I've built a super-crazy Wordpress framework that has a million and one shortcodes, one of those is a columns shortcode which supports a count parameter that allows you to define a column and the ...
2
votes
2answers
1k views

echo do_shortcode is not working on theme's template

I don't know whats causing the problem but the echo do_shortcode is not working on my theme's template, but its working on my plugin's template and the shortcode is working on my posts and pages. ...
2
votes
1answer
285 views

How navigation works in custom loop within shortcode?

I am using a shortcode to display a custom query. The shortcode is use in page. Everything is fine, only the navigation that I can't get it working correctly. Here is the function that I use to ...
0
votes
2answers
2k views

Stripping shortcode from custom excerpt function

I'm using the following function to create a custom excerpt for my homepage and categories pages so I can do it by character count and have a custom "read more". However, I have captions shortcode ...
2
votes
1answer
136 views

Short code for Venues

I am using the Event Organiser plug in and I am trying to setup the "venues." In the post my client and I would like a little more information on the venue to appear, I found the short code for the ...
1
vote
1answer
258 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
1answer
309 views

Adding option to Gallery shortcode

just starting out in WP dev, and I'm looking for any guidance I can get. What I'd like to do is use a hook or filter to add my own option to the core WP gallery shortcode. I would want it to work just ...
0
votes
2answers
886 views

passing parameters to do action from shortcode to wp_footer

Driving me nuts. I have a shortcode which works -fine- but for one detail. I won't post the entire thing, but it pulls the content of a post (works fine) then should echo a portion of it to a new DIV ...
1
vote
1answer
98 views

Enumerating shortcode attributes in JavaScript

I'm working on a plugin which uses a shortcode to call a JQuery function, and it requires three aspects to work: The JQuery code + its own code, to be included on the pages it will be used on The ...
1
vote
2answers
534 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() { ...
0
votes
1answer
319 views

shortcodes output before content [duplicate]

Possible Duplicate: problem with short code Shortcodes are broken. For those of you playing at home, heres an easy step by step to replicate my problem. 1) Open a fresh Wordpress ...
0
votes
1answer
634 views

Shortcode for Twitter Bootstrap Collapse

Im trying to create shortcodes for Twitter Bootstrap Collapse. This is what Im trying to achieve: [collapse-group] [collapse accordion="#accordionOne" title="my heading1"]some text[/collapse] ...
2
votes
1answer
462 views

Prevent add_shortcode from escaping a tag

In my plugin, I'm rendering a shortcode with some inline JavaScript. Wordpress seems to hate the closing CDATA tag (]]>), as it escapes it. I'm using CDATA blocks so as to render well-formed XHTML, ...
1
vote
1answer
109 views

Single post content custom order

In my post I have a shortcode for [video] than text content. Single post page displays first entry-meta, than title, than content [video] + text. What I need is to add some condition in single.php so ...
0
votes
1answer
1k views

Shortcode output always showing at top of page

my shortcode output won't appear where I put it, but rather at the top of the content (top of the post/page content). And here is my code function service_shortcode_index() { global $content; ...
4
votes
2answers
2k views

TED talks shortcode not working

I am trying to embed a Ted talk video using the shortcode: [ted id=myid] But it's not working. It shows the text instead of the video. Is there any configuration I need to check to make it work?
2
votes
1answer
173 views

How to create tabled index of posts in a certain category

I have a tech blog, what I want to do is to create an index page for articles in a certain category. For example, I want all the articles under the category "WordPress BasiX" to be arranged in an ...
-1
votes
1answer
474 views

Create plugin/function to catch XML-data via Shortcode

I need to display data from an XML-file inside Wordpress posts, and I want to use shortcodes to do it. I have this XML-file witch I need to get the data from; ...
0
votes
1answer
995 views

Using do_shortcode with variables?

Struggling to get the format right for the PHP in this do_shortcode embed using variables from Advanced Custom Fields plugin. I think I've tried every variation on ., ', and ". After reading every ...
-1
votes
1answer
563 views

Applying if (get_post_meta) to new shortcode

It's my first time here so here goes :) I've created a custom image field which allows me to upload new images, or have images added via a form from the frontend. I want these to display. I'm ...
0
votes
1answer
321 views

Testing for a shortcode using a function. 404 page throwing PHP Notice

I'm using the following function (can't remember where I found it, but I think it was written by pippin so thanks to him) to test for a shortcode. function has_shortcode($shortcode = '') { ...
1
vote
2answers
341 views

How to split <p> text text text </p> into array

I like to output and style in a shortcode, but the content that is get is the content of a page, so it's style like that <p>2012-12-12</p> <p>2012-6-23</p> ...
0
votes
1answer
139 views

Shortcode for tables which can include comma and linebreaks

Is it possible to make a shortcode for table which can include commas and linebreaks for its content? I've been trying to output something like this with shortcode: But it seems difficult. I tried ...
0
votes
1answer
2k views

Add custom attributes to a post

My blog is mainly composed of posts describing hiking. Actually, since I just moved from a Wordpress.com blog to a self-hosted Wordpress blog, every hike is inserted in a simple post. However, every ...
3
votes
1answer
2k views

Using wp_editor in shortcode

I am building a plugin for frontend submission. I am using shortcodes API to display the form for content submission, but I am having troubles. The problem is, wp_editor echoe's data, and shortcode ...
-1
votes
3answers
409 views

do_shortcodes() isn't working

I'm making a homepage template for my theme and I want to call a plugin, namely royalslider. Surely do_shortcode('[gallery id= "1"]'); Should do the trick?
0
votes
1answer
223 views

Create Widget or Enable Shortcodes in Sidebar

I'm well aware that WordPress by default does not process shortcodes in the sidebar. My question is why. I'm building a very small plugin that exports some content when the shortcode is present. This ...
2
votes
1answer
2k views

How do i reference the theme path in pages for images?

How do i reference images in a page/post without installing the php plugin or typing it out manually like this: domain.com/wp-content/themes/mytheme/image.jpg
-1
votes
1answer
157 views

Wrapping a function in html tag and return?

I am creating a shortcode. The shortcode will output a list of pages with the wp_list_pages() function. I am using the ('title_li') parameter and the list headline will be removed, because it is left ...
0
votes
1answer
260 views

Why is my custom post query shortcode only showing 1 post?

I created a shortcode for a custom post type so I can show the posts in a page. It works, except it only shows 1 post. here the code... anyone know what's wrong? // this is the shortcode function ...
0
votes
1answer
184 views

Don't show images inserted into content

I'm using a lightbox plugin to display my post images with [gallery], it works but those images show up in the content area too. So there are thumbnails and full size of same image. How can i hide ...
0
votes
2answers
132 views

Shortcode interpreted as text

I have the following shortcode in one of my pages [[Intern: Termine/News]] This works on a password protected sub page. Now I want that all news of the category Termine/News are on the parent page. ...
0
votes
1answer
960 views

conditional shortcode not working

I'm using a plugin, NextGEN gallery, to display photos. Each gallery from this plugin corresponds to a different sub-page, so I'm using conditional shortcodes to assign the right gallery to it's ...
4
votes
3answers
670 views

Show shortcode without executing it

I am trying to display code in my WordPress page and it isn't working. Everything I read says that you should be able to just use pre tag with code tag and it would be good but when I try to display a ...
0
votes
2answers
178 views

problem using $var for shortcode attr value

I am trying to pass a variable value to a shortcode attribute. I can't get it to work. Is the following supposed to work, or must values be literal? $mycat = 'books'; $myshortcode = '[products ...
0
votes
1answer
123 views

manipulate a plugins shortcode

I want to add some javascript directly below content, added by another plugin's shortcode. We are using the NextGen Gallery plugin and there are many articles containing the [nggallery] shortcode. I ...
0
votes
1answer
97 views

Wordpress do_shortcode first iteration

I've created a recursive shortcode that looks like this. [tabs] [tab state="active"]Home[/tab] [tab]About[/tab] [tab]Contact[/tab] [/tabs] [tabcontent] [tabpane]Content 1[/tabpane] [tabpane]Content ...
0
votes
1answer
3k views

call shortcode in javascript

I want to display a shortcode through jquery after the DOM is loaded: This is how I call the shortcode: <?php echo do_shortcode('[plugin]'); ?> Now, my question is how can I call that ...
2
votes
3answers
1k views

WordPress gallery 'post_gallery' filter doesn't work with feeds?

We can use the post_gallery filter to modify/replace the default WordPress gallery template (AKA output code) to suit our needs. But this doesn't seem to affect the markup in RSS feeds. No matter ...
-1
votes
1answer
39 views

Shortcode returning specific content of a post

I'm currently building a plugin to display specific part of post after accepting verification code. Can a shortcode return a part of a post? I mean: Bla bla bla [shortcode postID="100"] Special bla ...
1
vote
1answer
215 views

plugin shortcode output

I have a plugin which uses this shortcode: [daisy] And the html output of this shortcode is : <a class="clickable">Click Here</a> Plugin is working perfect if I use the shortcode to ...
0
votes
1answer
210 views

display custom portfolio tags

This is a part from the code that is used to display portfolio categories: $post_cat = array(); $post_cat = wp_get_object_terms($post->ID, "portfolio_category"); ...
-1
votes
2answers
852 views

Shortcode attribute “title” doesn't appear in $atts array

In a post, I have this text: [bhours shortcode="test" title="test"] But the "title" attribute appears to be ignored. Here's a var_dump of the $atts attribute array array(1) { ["shortcode"]=> ...
1
vote
1answer
2k views

add_shortcode() not working inside of function

I have a custom post type bhour, with a field bh_shortcode. When a post of this type is saved, I'd like it to add a shortcode based on the post's value of bh_shortcode. If the value of bh_shortcode ...
0
votes
2answers
326 views

add php shortcode in return function

I have this part of code: return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />'; What I want to do is to return also a php ...
2
votes
2answers
926 views

How do I preview the result of a shortcode in the TinyMCE editor?

I have created a shortcode via the Shortcode API that does something like this: [accordion_item numero="01" primeiro="true"]Item 01[/accordion_item] [accordion_conteudo] Lorem ipsum dolor sit amet, ...
-1
votes
1answer
300 views

Shortcode append to the the_content()

Currently I have a short that embeds a div into the the_content. This works fine like thus: [shortcode param=1 param=2] This returns a message at the end of the post, but within the current article, ...
0
votes
1answer
135 views

how to show last 5 images from the one post gallery

i want to get the 5 images of a one post gallery and show this random, example : [gallery id="123" orderby="rand" {numberpost=1 } or offset ? ] [gallery] codex tanks for help me.
1
vote
1answer
237 views

Function to show only first instance of shortcode

I need to add a function to my theme to remove additional instances of a shortcode in a post. First off I wonder if i'm approaching this wrong, but I have a theme that is drastically reformats the ...