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

contact form 7 database short codes

I am using contact form 7. I have successfully added to my page, Now I want to export the database onto a separate page with short code. I have the following code, but it results in the following ...
1
vote
2answers
855 views

Why Won't my jQuery Play Nice with Wordpress?

Code in question here: http://pastebin.com/PN29WKNq It worked on the HTML page I tested it on. Its supposed to add "display: none" to the content divs and then add "display: block" when the ...
0
votes
1answer
2k views

Shortcode to display the latest news article within a page

Could someone help me write a custom shortcode to simply display the latest post anywhere in Wordpress? I've seen a lot of ways how to do this in pure PHP in a custom page template, but if I try to ...
0
votes
1answer
95 views

grab or load text on demand

What i want to do I want some content (could be stored any where in a post or custom field) to load only when the user clicks for it to load. This content could be any thing (text,images,html etc) ...
3
votes
1answer
260 views

Adding Custom Fields for Img in Posts

I'm wondering how I'd be able to set a custom field within my Wordpress posts. I want to have a field available to add an image via the Post dashboard - that has a max width & max height set, I ...
1
vote
1answer
742 views

check for shortcode in post/pages AND widgets AND template files

For the next version of my plugin www.mapsmarker.com I would like to output the plugin´s css and js-files only if the shortcode [mapsmarker ...] is used. For posts/and pages I already found this ...
0
votes
1answer
738 views

jQuery Tabs in Shortcode API

Pastebin of the html prototype and my attempt at the wp function -> http://pastebin.com/91zBv8sk I want a simple notation so its easy for new users to use. So something like this: [tabs] [tab ...
0
votes
2answers
224 views

Echoing Shortcode content inside the loop

Im trying to echo the content from inside shortcodes into a conditional. I have two shortcodes like this: function fb_fans( $atts, $content = null ) { return $content; } add_shortcode( 'fans', ...
0
votes
1answer
144 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
777 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
266 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
198 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
169 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
148 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
165 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
660 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
3k 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
655 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
191 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
866 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
1k 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
363 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
989 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
217 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
225 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
438 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
616 views

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

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
874 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
189 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
891 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 ...
2
votes
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
278 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
215 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
1k 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
591 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
656 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
204 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
86 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 ...