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
2answers
870 views

shortcode inside another shortcode

I wonder if is it possible to have a shortcode inside another one? My scenario is this: I create a shortcodes to display content into columns so I can manage the layout of the page more easily. Now ...
0
votes
2answers
215 views

Shortcode does not expand in Facebook like

I am using Facebook Like Button plugin on pages that just contains a shortcode. When I Like the page and post to Facebook, it shows the shortcode without expanding it. I want to show the expanded ...
0
votes
1answer
222 views

Problem using explode inside add_shortcode() callback funciton [closed]

Explode not working as i expect inside add_shortcode() callback funciton. Here is the scenario: My implemented sortcode is like this: [table] name1 = value1; name2 = value2; name3 = ...
1
vote
2answers
1k views

Short code to display a loop

I've been working on this shortcode w/o any success... function loop_shortcode( $atts = '' ) { '<div class="clear"></div> <div class="childs grid_12"> <?php $the_query = new ...
1
vote
2answers
413 views

Create a short code to display a specific loop

I'm breaking my head trying to create a short code to display certain loop, however I'm totally cut, I can not figure it out how to do it, since it's the first time I try to do it... I do now want to ...
1
vote
2answers
573 views

Add the last viewed post title to a contactform with shortcode

I'm using the contactform 7 plugin and i want to add the title of the last viewed page (The page visited before the contact) to the dynamic field of the plugin with a shortcode. Is there a way to do ...
1
vote
1answer
833 views

Are shortcode functions applied while rendering the content, or are they executed and stored with the post content?

I'm not sure if I've asked the question properly, apologies for that! What I'm trying to do is, output a <!--nextpage--> tag via a shortcode. But it doesn't work, I guess because shortcodes are ...
1
vote
4answers
184 views

Snippets: is it better to add them in functions.php or make site-specific plugins?

Should "snippets" (short code or functions) be added to: the theme's functions.php? OR make site-specific plugins? Which is better from technical, security, performance, etc., standpoint? ...
4
votes
1answer
812 views

How do I escape a ']' in a short code?

How do I escape a right bracket in a short code? I'm working on a Google Map plugin that has encoded points. Sometimes the polygons have the ] in it, which makes WP think that it's the end of the ...
1
vote
1answer
988 views

how to get shortcodes to work inside the text of custom fields

I am building a learning management system using Wordpress, custom fields, and various plugins, especially SIMPLE FIELDS by Par Thernstrom. My shortcode plugins, such as Shortcode Exec PHP and Custom ...
0
votes
1answer
275 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
212 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
950 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
573 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
613 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
199 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
81 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
238 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
285 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
595 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
895 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
116 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
184 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
51 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
45 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
382 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
555 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
287 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
530 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
750 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
784 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
2k 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
325 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
708 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
77 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
961 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
1k 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
204 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
204 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
63 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
421 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
144 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
834 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
151 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
717 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 ...