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)

0
votes
1answer
269 views

Getting metabox value within a shortcode?

Is it possible to get page's metabox value within shortcode that is executed on that page? Scenario: I have a sidebar metabox for every page. I have some kind of custom gallery shortcode. My ...
1
vote
1answer
2k views

What is the best way to enable nested shortcodes?

Is this the best way to enable nested shortcodes?: add_filter( 'the_content', 'do_shortcode' ); I keep finding mixed results and want to be sure I won't break anything else!
0
votes
2answers
204 views

How to deal with Wordpress bug: can't use wrapped and unwrapped shortcode on same post

After trouble parsing wrapping and non-wrapping shortcodes on the same page, I came across this trac ticket from 3 years ago: http://core.trac.wordpress.org/ticket/9264 The trouble is WP cannot ...
-1
votes
2answers
850 views

shortcode causing the_content() to return blank?

I have a shortcode that just retrieves some info from the options table in the database. For whatever reason, when the content reaches a certain character limit the_content() to return blank? The ...
0
votes
3answers
540 views

How to execute a shortcode?

I have a WordPress option that stores some data, like: <h1>Header</h1> <p>Paragraph</p> [shortcodesomething/] [shortcode]Contents[/shortcode] I'm displaying this option's ...
3
votes
4answers
548 views

Run shortcode before filters

My users post snippets code in comments. I created a shortcode for this : function post_codigo($atts,$content=""){ return '<code>'.$content.'</code>'; } ...
0
votes
1answer
1k views

Gallery Shortcode: using size=“full” doesn't call the actual thumbnail image size

I have my Media settings set up so that my thumbnail size is 60x60 pixels and the "Crop thumbnail" box is checked. I can see in the /uploads folder that there are in fact perfect square 60x60 ...
1
vote
1answer
195 views

Can someone please tell me what is wrong with my plugin?

Two days back a made a plugin that allows me to insert toggle box in to the post with the shortcode [toggle Title="My title"]toggle test[/toggle] I also posted my plugin on WordPress.org plugins ...
0
votes
1answer
79 views

How to add a shortcode that creates an adjacent column of text in the content editor?

I'd like to enable a shortcode toolbar button, similar to the "More" break, that I can click to mark an insertion point where the text should be broken into columns. Do shortcodes have encapsulation ...
1
vote
1answer
235 views

Conditional Shortcode image display

Got a problem with a shortcode.. i probebly dont know where & how to set the condition so it will display the right image according to the topic / category of the toturial.. Help Plz :) function ...
0
votes
2answers
276 views

Best tools for preparing and styling a table

What are the best tools for preparing and styling a table in Wordpress easily? Update: I want to prepare and publish the tables in any page or post. So I think it might be easier if they can be ...
0
votes
2answers
549 views

Is it possible to check for shortcodes on a page?

Is it possible to check what shortcodes are used on opened page using PHP/WP functions? Why do I need it? I have special div ("#page-navi") on every page and when user uses [portfolio] shortcode I ...
0
votes
2answers
838 views

Shortcodes not working

I have WordPress 3.2.1 and I have created a personal shortcode, everything works fine until I change the Permalink Settings from Default to Custom Structure. The shortcodes stop to work permanently, ...
1
vote
0answers
111 views

include a post unrendered into a post, then render the whole thing [closed]

With a few extra lines in my functions.php I've created a shortcode that lets me include the content of a post: function include_content( $atts ) { $id = (int) $atts['id']; if ( ! $post = ...
1
vote
1answer
180 views

Button Shortcode

I am trying to create a custom button shortcode, with multiple color and size options. However, when I try to use the shortcode in my post it isn't showing up. My Function function btn($atts, ...
0
votes
1answer
46 views

Shortcode Variations?

The function below creates a button when used like so [btn]Button Text[/btn] function btn($atts, $content = null) { extract(shortcode_atts(array('link' => '#'), $atts)); return '<a ...
0
votes
1answer
44 views

How can I replace content on site generated from plugin without changing plugin

I downloaded a login form but I'd like to change its content without actually changing the plugin files so that it won't cause problems when updating later on. How can this be done?
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 ...
0
votes
1answer
349 views

shortcodes between square and curly brackets

I'm having difficulty searching for the answer to this question since {} and [] don't seem to affect search queries. My question is simple: how are these syntaxes different in meaning? ...
0
votes
1answer
543 views

Can 'Custom Field' data be inserted into this Short Code?

I have created a custom page template. In the template, I use a shortcode for JJ NextGen JQuery Slider. I would like the page to have a 'custom field' called 'Image Gallery' with a value that derives ...
1
vote
0answers
276 views

Building a WP Shortcode: Loading Markers on a Google Map [closed]

I'm learning about plugins. I've built a basic Google Map plugin. But, I'm having problems putting markers on the map. I've pulled the lat long coordinates from a mySQL db. I'm following the Using ...
0
votes
2answers
504 views

get_posts not working on homepage?

I have a simple custom shortcode plugin where you give it a tag and it'll display the titles of all the posts with that tag. e.g. In my post if I type "[listposts tag=oct-2011]" it will output the ...
0
votes
2answers
676 views

How to detect if a Shortcode is being called on a page?

I'm trying to push some variables to google analytics and would like to be able to detect if a shortcode has been included on a page at all. Anybody know a smart way going about this? Thank you! ...
1
vote
2answers
714 views

Placing <div> tags on wordpress visual editor using shortcodes

Hello I need to have the following code on a specific page: <div class="searchbar" > <div class="searchbar-inner" > search <input type="text" id="search" ...
1
vote
1answer
1k views

Should custom meta boxes be able to output shortcodes the same as Wordpress' native post editor?

Simply put: Should custom meta boxes be able to output shortcodes the same way as Wordpress' native post editor? Reason I ask is because Ive created my own custom meta box for inputting a shortcode ...
0
votes
1answer
305 views

Allow tags between shortcode in comments

On my personal blog, I would like commentors to be able to post code using certain shortcodes (eg [html], [css], [js], [php]). I still want to strip tags for comments for security reasons, but allow ...
0
votes
1answer
620 views

post content and shortcode content displaying out of order

I've seen a couple of questions that address this problem but I can't seem to get it to work based on the answers given. I have 2 plugins that I've written myself that output content via shortcodes. ...
0
votes
1answer
76 views

Execute Shortcodes when submitting post

I'm using shortcodes to insert some image links to my posts I grab from XML files (by an ID). As this needs to be executed just once it's not necessary to this everytime a user loads the page. So how ...
0
votes
2answers
120 views

Replacing custom field with shortcode

I've been using custom fields for my wordpress theme, but i'd like to use shortcodes now for easier posting. so before, in my index.php i have this: <?php echo get_post_meta($post->ID, ...
1
vote
3answers
885 views

How Can I Pass the Shortcode's $atts Variable to the Plugin's Javascript Function

I need to pass a plugin's $atts variable to a javascript function, but I'm not sure how to do it. The javascript function needs the shortcode's php latitude variable in order to build the map. My ...
0
votes
3answers
975 views

Can a shortcode included in post content add styles to the <head>?

I have a shortcode that iterates through a list of custom post types and, as part of displaying them, creates a block. In HTML5, it is illegal to have a style block outside the header (maybe in other ...
1
vote
2answers
203 views

How can I hide the Permalink/Shortlink for certain user logged in Users of a certain level?

I would like to keep logged in Users who can write and edit their own posts from seeing the Permalink/Shortcode for the post (located under the Title field). I've been able to cut out other features ...
0
votes
1answer
187 views

Default Attributes in Shortcode Not Working

I'm learning about shortcodes. My shortcode is working fine. But, I'm not getting the default values for the attributes. function csf_cap_databaseinfo($atts,$content=null) { global $wpdb; ...
0
votes
1answer
62 views

Substituting value via shortcode

function add_listing( $atts) { extract( shortcode_atts( array ( 'sslug' => '', 'jslug' => '' ), $atts ) ); global $wpdb; $qstr = ' SELECT * FROM $wpdb->posts LEFT JOIN ...
0
votes
1answer
386 views

Shortcode, Concatenating & Parse error: syntax error, unexpected T_FOREACH

I'm learning how to write a shortcode. I'm getting this error: Parse error: syntax error, unexpected T_FOREACH . I'm having problems with concatenating it properly. <?php /* Plugin Name: My ...
0
votes
1answer
135 views

Can't get default values to work with custom shortcode

I'm working on creating a shortcode to embed locally hosted Quicktime movies, but I can't seem to get the default attributes to stick. Here's what I'm working with, can anyone spot anything obviously ...
0
votes
2answers
816 views

do_shortcode() in twentyeleven theme

I observed a difference between twentyten and twentyeleven themes. Let me explain with an example: example.com/category/health-beauty/ finds one post containing just a shortcode. If I use twentyten, ...
0
votes
2answers
146 views

Shortcodes dont work online

i created some shortcodes which i have include into functions.php This is the shortcode.php code i have used: // alert box function alertBox($atts, $content = null) { ...
0
votes
1answer
617 views

get_shortcode_regex() only matches first shortcode

The Codex has an example of using get_shortcode_regex() to check if a shortcode is being called on a given page: $pattern = get_shortcode_regex(); preg_match('/'.$pattern.'/s', ...
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
1answer
395 views

Extract all shortcode data from post into loop variables?

My client wants to have several pages in which he can edit small, separate parts of a Wordpress page. For example, there is a callout box in the upper left corner. There is also a small piece of ...
1
vote
1answer
907 views

TinyMCE buttons that launch Ajax-generated forms

if i follow the tutorials on how to add tinyMCE buttons for shortcodes ( for instance: http://www.garyc40.com/2010/03/how-to-make-shortcodes-user-friendly/ ) if i create a button that launches a ...
0
votes
1answer
320 views

How to attach sidebar to shortcode's output?

I have one shortcode that should be always next to the sidebar: // [shortcode] otuput | default sidebar My theme allows me to set different sidebars for each page. So I have sidebars on a few ...
0
votes
1answer
110 views

Shortcode returns values in the wrong order

I have a shortcode function that returns: return '<ul class="list-pages">'. wp_list_pages( $args ) .'</ul>'; Of course it returns: {pages} <ul class="list-pages"></ul> ...
0
votes
1answer
234 views

Multiple Content Shortcodes

I was trying to create a shortcode for a multiple tabs panel. The user can set the number of tabs, the titles and the content for each. It would be something like : [tabs number='4'] [tab ...
-1
votes
1answer
546 views

Changing the title tag from a shortcode

I currently have a shortcode which dynamically swaps out locations on a page to make each page specific to a location. For example the url http://mywebsite.com/offers/scotland/ Would make the H1 ...
-1
votes
1answer
653 views

Calling function from within functions.php returns unwanted value

I am trying to customize the output of the [gallery] shortcode to include comment count by this plugin: Facebook Comments for WordPress plugin I found a function by Zack Austin (shown below) that ...
0
votes
2answers
487 views

Populating shortcode values dynamically in theme template

I'm trying to use a jquery toggle shortcode in a theme template. The shortcode goes like this: [sws_toggle3 title="Title"]You can now see the displayed text.[/sws_toggle3] I want to pull posts ...
0
votes
1answer
165 views

Rename Smart YouTube's httpv back to http for all posts

I've used the Smart YouTube plugin to embed YouTube videos into my blogs. The way I did it is to replace the http:// of the YouTube url with httpv:// as the plugin describes. But now I noticed that ...
1
vote
3answers
342 views

Custom CSS for plugin form

I have a short code that is adding a form to a page. How do I ensure that the CSS for the form is loaded in time with the shortcode?