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
141 views

Shortcode Attribute

I want to assign a title to my column shortcode. Essentially, [column title="nameofcolumn"]content[/columntitle]. But I'm not quite sure what to do after the "=>" or after my div class of title. ...
0
votes
1answer
767 views

Enclosing Shortcode not working in a Template

I've use the following code for an enclosing shortcode and it works perfectly in the posts. function date_code($attr, $content) { return '<h3>' . $content . '</h3>'; } ...
-1
votes
1answer
139 views

Shortcode not picking up custom field

I created a custom field that allows me to set the cropping style of timthumb, but I am also using short code to populate a page with blog posts, but the shortcode isn't picking up the customfield, so ...
0
votes
1answer
260 views

Add title & subtitle to shortcodes

Is there a way I can add a custom title & subtitle to this shortcode function? function spoiler( $atts, $content = null ) { return '<div class="moreinfo"> <h3 class="click drop ...
1
vote
1answer
196 views

Use [shortcode=“value”] instead of [shortcode att=“value”]?

With shortcodes that have only one attribute, it would be much easier from a content-editing perspective to use, for example, [icon="myicon"] instead of [icon whichicon="myicon"]. Is this possible in ...
0
votes
1answer
28 views

How do I output a list of a specific post type in a table?

I've used the Custom Content Type Manager plugin to create a new post type of "Job". It includes a couple custom fields for "Location" and "Job Type". I have a page called "Jobs", and now I'd like to ...
12
votes
5answers
2k views

How to include code only on specific pages?

I'm learning about plugins and shortcodes. I noticed that when I activate my plugin its code gets loaded on all of my pages-- even pages that don't have my shortcode. (I don't mean content vs. admin ...
5
votes
2answers
2k views

Add custom shortcode button to Editor

Before the new version of Wordpress 3.0 came out I was using this jQuery code below to add custom buttons for my own shortcodes to the editor toolbar in the admin panel, it worked great. However with ...
1
vote
2answers
160 views

How to return multiples lines in a shortcode?

I found this example of a shortcode on the Internet: function project_shortcode( $atts, $content = null ) { extract( shortcode_atts( array( 'class' => '', 'id' => '', ...
0
votes
1answer
145 views

Show shortcode only in posts

I created a shortcode to show the short URL from a post. I use canvas, that has an option to show shortcode after content, but I only want to show the shortcode only in posts, not in homepage. How is ...
0
votes
1answer
160 views

how to create a fav icon shortcode?

i wonder if there is a good way to create a shortcode that retrives a remote website FAV icon... i found this: ANSWER and tried to create a shortcode using it but failed (since i sux at shortcodes!) ...
2
votes
1answer
1k views

passing multiple parents value into a shortcode

I need to pass a few values into the parent attribute of the wp_query. However I'm using a shortcode, so, If I pass a single value works perfect, but if I need to send multiple values it breaks, would ...
1
vote
2answers
642 views

Display gallery on top before content

Is it possible to execute the gallery shortcode before any other content no matter where the shortcode is in the post HTML?
0
votes
3answers
1k views

Shortcode content not displaying on Home page

Why don't shortcodes work when a post is view on Home page but they do when viewing single post. You can see the issue here. There are suppose to be two element's above the image - generated by JW ...
4
votes
1answer
2k views

Solution to render Shortcodes in Admin Editor

I have asked this question about a year ago and I am hoping there is some type of simple solution which will allow me achieve my objective. So here it goes: I often utilize shortcodes within the ...
0
votes
2answers
391 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 ...
0
votes
2answers
636 views

Echo custom field value in shortcode function

I must be doing something wrong here. I want to display the custom fields "pw_featured_note" & "pw_featured_price" Here is my code so far function featured() { ...
0
votes
2answers
186 views

Unable to process php via shortcode

I've been searching around for a fix to this and while I definitely have a much better understanding of my issue (thanks to similar queries posted by others) I am still not sure of the solution. I am ...
0
votes
1answer
827 views

Removing Shortcodes from Child Theme

I'm trying to remove the shortcodes from a child theme. In my functions.php file (for the child theme), I've put: function my_remove_shortcode(){ return ''; } add_shortcode('entry-twitter-link', ...
1
vote
1answer
996 views

extract shortcodes from string

i need a little help to with this issue: I have a string wich contains shortcodes like [shortcode data="1" data2="2"] How I can extract with regex? without wordpress system? Thanks in advance.
0
votes
1answer
2k views

How to add a shortcode to call a function

I'm using Cimy User Extra Fields to add more registration fields. I'm also using Contact Form 7 Dynamic Text Extension to pre-populate contact form fields. I've read, in order to be able to use Cimy ...
1
vote
2answers
1k views

Implement If-ElseIf-Else-EndIf with short codes

I have very little experience with WordPress and PHP, so I apologize in advance for syntax problems. I'd like to know if it's possible to implement If/Else logic as short codes. Something like: ...
0
votes
1answer
349 views

How can I call a PHP function inside a hardcoded shortcode?

Maybe I'm doing this the long way but I need to make something like this: <?php echo do_shortcode('[mu-events months="11" startmonth="today" orderby="time" orderas="ASC" sites="?> <?php ...
2
votes
2answers
926 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
427 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
596 views

Add the last viewed post title to a contactform with shortcode [on hold]

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
848 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
186 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
845 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
1k 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
276 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
213 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
976 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
583 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
631 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
201 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
84 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
239 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
289 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
605 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
902 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
117 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
186 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
46 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?