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)

1
vote
2answers
6k views

Include PHP file in Content using [shortcode]

Here is what I have I am not having any lucking finding how to simply include a file in the content editor using a shortcode. For Example if I wanted to include form.php inside my Contact Page how ...
1
vote
1answer
242 views

shortcodes displaying outside of content area with echo statement, not what I wanted [duplicate]

Possible Duplicate: Shortcode always displaying at the top of the page I have my shortcode system set up fairly normally, like so: //[carouselle] function carouselle_func( $atts ){ ...
1
vote
3answers
4k views

How to Insert Shortcodes into Theme?

I have content locker plugin. For locking contents, im using this shortcode: [wp-like-locker] Your locked content here... [/wp-like-locker] and I need lock every post on my blog. How could I ...
2
votes
2answers
2k views

Shortcode from a widget is wrapped in unwanted <p> element

I'm using Black Studio TinyMCE Widget as a rich text editor widget. In a sidebar I inserted the TinyMCE widget with a [testimonial] shortcode and some content after it. For example: [testimonial] ...
0
votes
3answers
2k views

How can I execute shortcode outside the loop?

I'm using Contact Form 7 and can display the form by putting the following in the content text field [contact-form-7 id="453" title="Contact form 1"]. Now I need to display the form outside the loop. ...
1
vote
2answers
1k views

Shortcode always displaying at the top of the page

I'm using a shortcode to pull in different loops via the loops-name.php. For some reason it is always at the top of the page. I googled it and using echo instead of return causes that problem but with ...
0
votes
1answer
87 views

post/page content

i am trying to insert a post/page into one of my themes files and it wont display shortcodes or php i have created a page called home in the wordpress admin-paned and inserted into my code the ...
0
votes
1answer
846 views

Is it possible to create a shortcode that will query a post based on taxonomies?

I am working on a site that will be listing a few hundred products and we wanted to be able to quickly/easily show specific products on a page based on taxonomies. I have been doing some research and ...
1
vote
4answers
274 views

Remove action from shortcode

There is add_action() function inside function which is callback for add_shortcode(). Any idea how to remove this action with the help of custom plugin? Should I hook to any action which is called ...
1
vote
1answer
238 views

Is there any inherent difference between add_filter() and add_shortcode() for modifying [caption]?

The context is the [caption] shortcode found in media.php which contains img_caption_shortcode img_caption_shortcode also includes these lines: $output = apply_filters('img_caption_shortcode', '', ...
0
votes
1answer
905 views

Twitter bootstrap tabs

Does some know how to do shortcode for Twitter bootstrap tabs or any other tabs? I found this tutorial http://michaelwender.com/blog/2010/11/01/creating-wordpress-shortcodes-for-jquery-tools-tabs/ but ...
1
vote
1answer
45 views

Shortcode help: If no image entered take default

I have a shortcode that creates an "opinion box". The user should insert 4 parts the title the images the opinion side of the image in relationship with text i want to check if no image was ...
1
vote
1answer
1k views

get_the_content(“more…”) returns full text

I'm creating shortcode [latest_post] and want to show post date, title and short content. (content has "more" separator). Here is code: function shortcode_latest_post() { global $post, $more; ...
5
votes
1answer
519 views

Change behavior of “Insert into Post” based on attachment metadata

For a custom plugin I'm working on, I have added a checkbox element to the attachments editor in a manner like the answer provided here: How to add a checkbox element to attachments editor with ...
1
vote
1answer
231 views

short code output too early

I'm trying to create a shortcode base on the following code: <ul class="filter"> <li>Filter:</li> <li class="link-store"><a href="<?php echo get_permalink( 23 ); ...
0
votes
1answer
102 views

filter title from shortcode

Just wondering how to filter to change the current page title from a shortcode, Since shortocodes are rendering after $post. any idea to archieve something like : ...
0
votes
1answer
302 views

Plugin renders in preview but shortcode shows when published

I was attempting to add this Flash Count Down plugin. The shortcode works fine in preview: But when published the shortcode is rendered as text: Is there a general solution to this problem or ...
1
vote
1answer
3k views

Stop auto formatting in shortcodes

Is there a way I can stop Wordpress auto formatting everything I enter inside a shortcode tag? A the moment I want to include a h2, a paragraph and another shortcode, but everytime I do Wordpress ...
1
vote
1answer
68 views

wordpress prevent multiple shortcodes

I created a wordpress plugin and I added shortcode feature to it. but i want to execute only one shortcode and prevent applying of multiple shortcodes if the administrator did so.
0
votes
2answers
288 views

How to process shortcode on post save and update only

Below is a simple shortcode I have so that in an article, I can simply link keywords to tag taxonomy pages in my site. So if I were to wrap the term Web Service like this [taglink]Web ...
1
vote
2answers
553 views

wp_nonce_field displaying twice

I have wp_nonce_field in my code but it's creating two instances to the html code for some reason, one where I'd expect it and another at the start of the entry. Is this correct or am I doing ...
2
votes
2answers
945 views

Organizing shortcodes. How to display all of them and their attributes?

1. My shortcodes I've developed multiple shortcodes for my own theme, I'm loading them in functions.php like this require_once (MY_URL . '/bartag_shortcode.php'). Here's an exemplary bartag ...
3
votes
4answers
4k views

How to check if a shortcode exists?

I'm using do_shortcode function to add shortcode in my template. But i would like to check if that shortcode exists before display them. I mean like this If (shortcode_gallery_exists) { echo ...
1
vote
2answers
791 views

The result of a shortcode appear BEFORE page content

I have a page, with a shortcode that get all the post from a categorie and put after the content of the page. For no apparent reason, the result of a WP_Query() in the shortcode APPEAR ALWAYS at the ...
0
votes
1answer
3k views

how can I add a “read more” tag directly in the template?

how can I add a <--more--> tag directly in the template? I mean, the exact php code to use in a template for that shortcode. I need it for a script that makes use of that shortcode to hide content ...
5
votes
1answer
7k views

How to use other shortcodes inside Contact form 7- forms? [closed]

I noticed that any shortcode that is not part of the contact form 7 builtin shortcodes dont work. For example: I am trying to use an accordion shortcode between form elements in contact form 7. But ...
0
votes
1answer
2k views

Shortcode to display all the post from a category in a page

I have 10 category, and when i select a category in the sidebar il list all the post from that category.... FINE, beautiful Now, i like a page, with some text and photos and then after that content, ...
0
votes
1answer
437 views

Using Variables in Shortcodes

I'm trying to create a Shortcode to display scores between to teams. I've got this far, but I can't seem to get variables into the damn thing. I thought the arrays where used for that, but apparently ...
0
votes
2answers
662 views

Display post_meta in Shortcode

Simple shortcode turning overcomplicated <?php function recent_posts() { $q = new WP_Query( array( 'orderby' => 'date', 'posts_per_page' => '1') ); $list = '<ul>'; ...
2
votes
1answer
2k views

Tinymce list of shortcodes button

does someone know about tutorial or how to do button with list of shortcodes in tinymce? For example like in this video http://www.youtube.com/watch?v=DmzUuwW9AU4 (This function in the video is exatly ...
1
vote
1answer
629 views

Trigger shortcode after submit button pressed [closed]

I need to execute a shortcode after the user will press the submit button. I am using Contact form 7 and have inserted the form by a shortcode in the Post edit section. It's basically a form ...
0
votes
1answer
142 views

Shortcode not displaying video as expected

I have written a short code to display a video off of amazon, and it works. However it is not being placed as expected on the page. I have put the shortcode after the <!--more--> tag but the ...
0
votes
1answer
283 views

Gallery Shortcode Function Help

Okay, so I found this code online that allows you to add the option of how many thumbnails you want to show in the gallery shortcode. The code below is what they say to add to the functions.php file ...
0
votes
1answer
74 views

Loop output for custom plugin [solution found]

I am trying to update my plugins to be more user-friendly. One of the things i want to achieve is that i want my plugins output (e.g. for description-fields) to use the full functionality of all ...
0
votes
1answer
260 views

Shortcode not showing $content in correct place

I asked this elsewhere but I'm not getting very far with the answers, so thought I'd try here as it's specific to Wordpress. I have this shortcode: function reytab($atts, $content = null) { ...
1
vote
2answers
505 views

Conditionally loading Facebook PHP SDK in shortcode

Since 3.3 we can enqueue scripts conditionally right in our shortcode functions, but when I tried to do this with some PHP class (uses session_start() in the __construct() function) as you can guess ...
0
votes
1answer
213 views

Trying to display short code content in template file with do_shortcode()

I installed the WP Issuu plugin on a site and tried to use do_shortcode() to render the shortcode in the template file. Strangely it doesn't work, although it does for the [gallery] shortcode. I.e. ...
9
votes
4answers
16k views

How to manually fix the WordPress gallery code using PHP in functions.php?

It's been talked many times that Wordpress outputs some really bad code for the built-in gallery function. This is the core code responsible for the gallery output (in /wp-includes/media.php): ...
0
votes
1answer
1k views

Use a shortcode to display custom meta box contents

Is this possible? If so, can someone point me towards a clear tutorial? I have a column of content I want to float right of the_content, so I'd like to be able to use a shortcode to put that content ...
6
votes
2answers
290 views

current_shortcode() - detect currently used shortcode

In a plugin class I want to provide simple fields for public data: email, phone number, Twitter etc. The list can be extended. See the plugin Public Contact Data on GitHub for details. To keep the ...
0
votes
2answers
229 views

Where to upload my new custom ShortCode in Separate .php file?

I wrote my first ShortCode in a file called: myShortCodes.php. Does the add_shortcode go in the same PHP file as the ShortCode itself? Where do I upload it? How does WordPress know to look in my ...
0
votes
1answer
92 views

Shortcode into the same shortcode

I'm working on a theme for a framework, and using shortcode to divide the layout, I've found the following problem: Into a content, I can divide the container into 12 different parts, it also applies ...
0
votes
1answer
1k views

the_excerpt and shortcodes

I'm using the_excerpt on my index page. I'm also using a dropcap shortcode at the beginning of each of my posts. On the index page the posts will not display the letter with the dropcap shortcode ...
0
votes
1answer
746 views

Emdedding PHP in shortcode $content

I have created an enclosing shortcode that is styled to be a button with the intention of putting content in it. I am echoing this shortcode inside a theme file and want the content to link to a ...
2
votes
1answer
97 views

Add page title as a javacript variable to specific posts

I'm very new to WordPress and I'm sorry if this question may sound ridiculous. I need a way to add the post title into it's content, only in specific posts, and not always at the same place in the ...
0
votes
3answers
3k views

How to pass multiple values in shortcode?

All I am using formidable plugin and on one page i need to use 5 shortcodes. [frm-entry-delete-link id=9 page_id=25 field_key=hsn108] [frm-entry-delete-link id=12 page_id=25 field_key=cp7pi] ...
0
votes
1answer
91 views

Compatibility of MathJax extension and JetPack

I just installed the MathJax Extension for Wordpress because I did not really like the way the math were rendered with the [latex] tags provided with the JetPack. If I use the classic $$, the blog ...
1
vote
2answers
1k views

Remove width and height attributes from [gallery] output

WordPress automatically adds the width and height attributes to [gallery] shortcode images. How to delete these attributes? Something like this but for [gallery] output.
1
vote
1answer
923 views

Get the content inside shortcode and apply external function to it?

function t_shortcode($atts, $content = null){ $lang = strtolower($atts['lang']); $content = "<div id='translator' class='translate_".$lang."'>".$content."</div>"; if($lang == ...
0
votes
1answer
154 views

Insert shortcode before and after a list automatically

I'm setting up a custom page template and I'm building a widget on it that lists albums with track lists. I use a plugin that allows me to expand text which is what I use to show tracks of the albums ...