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
1answer
228 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
294 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
2k 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
277 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
532 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
905 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
762 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
6k views

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

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
422 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
648 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
614 views

Trigger shortcode after submit button pressed

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
141 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
278 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
73 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
249 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
497 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
15k 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
283 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
224 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
717 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
96 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
256 views

Shortcode and Theme

In my post, I am using a shortcode [slickr-flickr tag="MyAlbum"] to grab images from flickr. This shortcode is available for my wordpress via Slickr Flickr plugin. When I put this shortcode in my ...
0
votes
1answer
89 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
873 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
153 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 ...
0
votes
1answer
153 views

Using a custom field inside a shortocde

Im trying to use a custom field inside a shortocde for a nextgen gallery slider on a page. The goal is to change the gallery id by entering in the corresponding id on page creation with a custom ...
0
votes
2answers
898 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
840 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
259 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
717 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
713 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
216 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
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
766 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
259 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 ...