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
3k views

How to call custom taxonomy categories with shortcodes

I've just had one questions solved over here: How to display posts from a single category within a custom taxonomy. Now I'm wondering how to take this code: <?php $args = array( ...
7
votes
3answers
323 views

how to show the syntaxis of a shortcode

i want to show the syntaxis in some posts about how to run a shortcode, I mean, something like this [myshortcode] but without running it, is that possible?
2
votes
2answers
342 views

Post the content of a specific “Custom Post Type” post within a post using a shortcode

The posts on our music blog usually include multiple tracks of music. I want to have each individual track be its own entity--a custom post type called "track"--which I want to be able to insert ...
3
votes
2answers
5k views

What kind of object type is WP_Query?

I am getting this error when I try to return the post_title value from my WP_Query: **Fatal error:** Cannot use object of type WP_Query as array Here is the code: $query = new WP_Query( array( ...
0
votes
1answer
729 views

Stream Video Player does not work with do_shortcode()?

I have downloaded a plugin called Stream Video Player, which has a shortcode. If I put the shortcode into the content editor, it works well and it displays the video. However, if, inside a template I ...
0
votes
1answer
256 views

hard code shortcode only on specific category

I am looking to embed several shortcodes into my post template, but I want the tags to be conditional to a specific category (and subcats). I've looked through the codex, but I'm unsure where to ...
2
votes
3answers
3k views

Custom form, shortcode, and submit handler

I have a frontend form with a bunch of input. My requirements force me to use a custom shortcode to create the form. I have already tested a page with that shortcode. Here's my : <form ...
0
votes
1answer
485 views

Nested Gallery Shortcode INTERMITTENTLY working

I have an Expand/ Collapse plugin which, via a shortcode, can expand/ collapse content. My expandable content is a shortcode of a gallery. See here: http://shop.dearearth.net/collections ...
2
votes
1answer
199 views

Browser title script ignoring is_page /else conditional [closed]

I've used this code to stipulate different separators for different pages in my clients site: <title> <?php if(is_page('Portfolio')){ wp_title( 'of', true, 'right' ); echo ...
0
votes
3answers
1k views

Wordpress global variables?

I've got page with metabox called "something". It can have two values "value" and "value2". I'm using a shortcode at this page and want it to display something's value. The problem is I don't know ...
1
vote
3answers
650 views

Get Posts shortcode plugin and meta_query?

I'm using Get Posts plugin to list posts with post type "project". I want to filter the list by two custom fields: year (ex. 2006) and state (ex. Completed). I added meta_query to the plugin's ...
3
votes
2answers
2k views

WordPress adds br in between my shortcode

I am having a problem where my markup is rendered incorrectly (more space because of <br />) as WordPress adds <br /> everywhere theres a line break eg. [x] [y]Hello world[/y] [y]A ...
0
votes
1answer
455 views

Dynamic number within shortcode

I need to write a dynamic shortcode. The original says: [... width="940" height="200" ...] I need to have this: [... width="<php>" height="<php>" ...] How do I get this to happen?? ...
1
vote
5answers
2k views

Display post shortcode content in the sidebar?

I need to display images and other content in the sidebar depending on a page. Pages are added dynamically and information that need to appear in the sidebar is different for each page. So I can't ...
0
votes
1answer
416 views

Hide/disable sidebar using shortcode?

The question is pretty simple, but it's complex in fact. I have implemented custom sidebars for each post/page function in my blog. It looks like: <div id="<?php echo ...
5
votes
2answers
5k views

How to add multiple buttons to TinyMCE?

I've followed a tutorial on Nettuts on how to add a custom button to TinyMCE (http://net.tutsplus.com/tutorials/wordpress/wordpress-shortcodes-the-right-way/) It works great and all, but i want to ...
5
votes
3answers
2k views

Is there a way to add another row to the tinyMCE kitchen sink toggle?

The tinyMCE "kitchen sink" toggle button shows/hides a row of buttons. I have successfully added my row of shortcode buttons to the tinyMCE editor, but I was wondering if there was a way to make my ...
0
votes
2answers
143 views

How can i share codes on my blog?

I want to add <code> tag to my post, easily. For example, Adding code is very easily in Stackoverflow and other sites. Basically, we can add codes between apostrophes (``) I need something like ...
0
votes
2answers
987 views

Can data from a Custom Field data be used by a shortcode on a per page/post basis?

I'm developing a site where better is very quickly becoming the enemy of the good. I would like to make updating as simple for the client as possible by enabling them to populate boilerplate and ...
1
vote
3answers
143 views

What is a short code?

I am new to WordPress and I've seen this term passed around.
3
votes
2answers
977 views

Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation

I really need some help, I dont know where else to turn with this request. I'd like to add a shortcode to one of my posts. The template tags get_next_post() and get_previous will not work for me since ...
4
votes
2answers
755 views

Remove wptexturize from a shortcode?

Is there a way to remove wptexturize only for a certain shortcode?
0
votes
2answers
2k views

How to turn this HTML code into a shortcode? (adding song lyrics and giving an id to a div)

STEPS: Don't forget to use different id numbers in each accordion. For example: id="5" (1 to 10) The title goes between the The lyrics before the Place 2 accordions per posts (like the example ...
0
votes
3answers
2k views

ShortCode and extra </p>

[box id='1' text="some texte"] the shortcode, at one point is outputting text the html result is : </p> some text </p> There is an extra closing paragraph in the start and and opening ...
0
votes
2answers
3k views

Using the title of the post in a shortcode

Hi I'm trying to use this plugin: http://wordpress.org/extend/plugins/wordpress-simple-website-screenshot/ I am supposed to use the shortcode: [screenshot url="www.example.com"] Because I am ...
0
votes
1answer
742 views

Shortcode content filter?

I'm looking for something, but don't exactly know what. I have a shortcode, let's call it [shortcode]. Users will input HTML tags inside, mostly images, but also links, images in links, etc., for ...
0
votes
1answer
480 views

Custom Shortcode Broken in Wordpress 3.1

A recent upgrade to wordpress 3.1 broke a custom plugin written to make use of shortcode in order to generate easy embed html for brightcove videos. Can anyone see what is happening in the following ...
1
vote
3answers
1k views

Shortcode doesn't work if I directly paste its function in a template file?

This is a shortcode to add a question form in the Question and Answer Forum plugin for Wordpress: [question_form width=\'x\' bordercolor=\'x\' style=\'x\']question form title[/question_form] This ...
0
votes
3answers
2k views

Automatically added brs and paragraphs?

Here's my very simple shortcode: function box_shortcode( $atts, $content = null ) { extract( shortcode_atts( array( 'width' => 'auto', 'height' => 'auto', ...
1
vote
3answers
711 views

stray <p> elements

I coded a wordpress shortcode for columns that basically inserts html via a shortcode. Problem is that wpautop adds stray p elements that renders the code invalid. To test put this into your ...
2
votes
4answers
1k views

Shortcode empty attribute

Is there a way of creating an empty attribute for a shortcode? Example: function paragraph_shortcode( $atts, $content = null ) { return '<p class="super-p">' . do_shortcode($content) . ...
1
vote
2answers
2k views

the_widget() and widget's ID

Let's assume I have a widget that displays only its name: <p> <?php echo $args['widget_id'] ?> </p> So when I drag & drop my widget to any sidebar it shows: ...
0
votes
1answer
154 views

Shortcode displays always first. Once again

OK, I've had a problem with echoes in my last shortcodem, but everything works fine now. But I have another one: function myWidget_shortcode( $atts ) { extract( shortcode_atts( array( ...
0
votes
1answer
268 views

Shortcode leaves no space for other elements?

I've created my own shortcode. I'm unable to share the code unfortunately ;/ When I use it on my pages it behaves strange. It always has the highest priority. I mean something like that in page ...
0
votes
1answer
1k views

Problem with shortcode inside a shortcode

I use this in my Functions.php file to format short codes for some jQuery UI tabs, however I also use a short tag to reference my video embeds, which breaks when they're inside the UI tabs. My ...
1
vote
1answer
558 views

How do I combine my shortcodes?

Example I want combine shortcode for first paragraph and dropcap. function st_dropcap( $atts, $content = null ) { return '<span class="dropcap">'.$content.'</span>'; } ...
2
votes
3answers
4k views

Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?

I've found this new plugin http://wpsmith.net/wordpress/creating-multiple-custom-menus-in-wordpress-3-1 that is using a new 3.1 hook (wp_nav_menu_objects) to remove specific nav-menu-items from the ...
0
votes
1answer
191 views

How to make post templates to include shortcodes only?

I used to post same shortcodes every time (shortcodes loads dynamic contents). So, I want to pack these shortcodes in a template for my posts. How can I do this?
0
votes
3answers
1k views

Shortcode attributes don't appear?

I'm working on my first shortcode, examples in Shortcode API are not suitable for starters, so I'm almost sure I'm doing it wrong! My shortcode: function hello( $atts ) { extract( ...
2
votes
1answer
1k views

Post loop created via shortcode not displaying shortcode in content

I've been racking my brain on this. Here is a shortcode loop I've created to display a specific post type: function faq_shortcode($atts, $content = NULL) { extract(shortcode_atts(array( ...
2
votes
2answers
2k views

How to call shortcode function directly and pass $atts

I am using the Media Library Categories plugin. It does not have much documentation, so I have concluded the way to implement it would be using the shortcode [mediacategories categories="6"]. I want ...
0
votes
1answer
212 views

Anyway to convert a plugin to become a shortcode?

is there any (easy) way to convert an existing plugin to become shortcode instead? http://wordpress.org/extend/plugins/rax-top-social-media-share-with-counter/ I want to place it's output ...
1
vote
3answers
167 views

Using a Shortcode to Replace Themes Stylesheet?

Is there a function to replace the active theme's stylesheet with a different one (not just adding a new one, but actually replacing the current one)? I'm developing a plugin, and using shortcodes ...
0
votes
4answers
578 views

Problem with running javascript in a shortcode

I am trying to create this plugin for my site that will allow create short codes to pull data from the iTunes Search SDK. I already have the iTunes Search SDK javascript plugin working that pulls the ...
3
votes
3answers
3k views

Add new “Insert Into Post” button with another function

Problem: Add a hook that automatically adds a short tag to video attachments when inserted from the Media Library (video) tab: Update: This works under the 'Media Library' tab — and doesn't break ...
1
vote
2answers
157 views

Shortcode But Without The Equals Sign?

I am aware of creating a shortcode this way: function font_fam($atts, $content = null){ extract(shortcode_atts(array( 'f' => '', ), $atts )); return '<span ...
1
vote
2answers
8k views

How would I create a shortcode to display a custom post within a page or regular post?

I would like to create a shortcode that will extract information for a custom post, and display it within a Page or regular Post. Specific use case: I have a custom post type "Film" for a film ...
0
votes
1answer
367 views

how to stop a gallery slideshow

I am using the Dynamix WP theme. I have three images displaying in a loop with fade effect. The images continue to fade from one to other. However I would like to stop this effect once all images have ...
1
vote
2answers
630 views

stop shortcode stripping in category and archive pages

Using the Wordpress default theme 2010 1.1, shortcodes work on the main blog page and individual post pages, but are being stripped out on category and archive pages. For example, stick in the ...
0
votes
1answer
348 views

Output loop to function return?

I'm working on a shortcode function that returns a category image, a link to the category, the last three posts in that category, and another link to the category. See my code below: ...