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
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
159 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
571 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
3k 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
1k 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
214 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
584 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
158 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
368 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
631 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: ...
2
votes
3answers
2k views

Custom Select Query with Custom Post Types

Have been trying to figure out the issue with this for the past hour, but hitting a wall. Basically I'm just trying to query my custom post type based on some custom date fields and then displaying ...
1
vote
1answer
1k views

Custom Post Type Loop within Shortcode

I'm really at loss as to why this isn't working: I am using a shortcode to display a query on a custom post type + taxonomy, this is the segment of it: // - arguments - $args = ...
1
vote
2answers
3k views

Trouble with editing template for “List category posts” plugin

WP 3.0.4 local installation, multisite network enabled theme: Twentyten plugin: List Category Posts v .15, network activated I've created the folder list-category-posts inside my theme folder, and ...
0
votes
1answer
780 views

How to create a shortcode to let the user add the ID of a YouTube video?

I use the following to add in a post a YouTube thumbnail and display the video in a fancybox: <div><a class="fancybox" href="#video2"> <img ...
0
votes
3answers
695 views

Looking for a way to include/embed text from a file on a page so that the short codes are processed

I'm using WP as a CMS. I've got multiple pages that share the same header. group 1 has header 1. group 2 has header 2. etc. I've looked at these two plugins for a quick way to insert a combination ...
2
votes
1answer
849 views

Custom shortcode in widget forced to top of widget

A custom shortcode i made is being forced to the top of the widget outside of the widget container. Any ideas why? This is my code... function nktmediaplayer_func($atts) { ...
0
votes
1answer
859 views

How to provide support for [gallery] shortcode?

I'm developing a new custom theme - and noticed that if a post contains the shortcode [gallery] it gets ignored (edit: I mean that the HTML delivered to the browser does not include [gallery], nor ...
0
votes
2answers
390 views

What is wrong with this Shortcode? I get it in a wrong place inside the content

Hi to the community, i try to build a shortcode that prints the Creative Commons logo and some text, everything is working fine except that i put the shortcode at the end of the post but the shortcode ...
0
votes
1answer
190 views

shortcode help require

i am having a wordpress function to display the latest 5 tweets of the user, this tweets can be displayed by two ways one is through direct entering the user ID in admin menu which i created, and ...
4
votes
3answers
1k views

Nested Shortcode Detection

If you are familiar with this code <?php $pattern = get_shortcode_regex(); preg_match('/'.$pattern.'/s', $posts[0]->post_content, $matches); if (is_array($matches) && $matches[2] ...
7
votes
2answers
25k views

How to customise the output of the WP image gallery shortcode from a plugin?

We're building a plugin that displays posts, and we also want to display the image gallery when it is used in a post. However, we need to limit the number of photos displayed? Is that possible?
5
votes
1answer
1k views

Styling Shortcodes in Visual Editor

Does anyone know how to style the visual editor so that when specific shortcodes are used they are replaced with an image within the visual editor? I have found that many users screw up the shortcode ...
1
vote
1answer
1k views

Pass variable to nested shortcode

I'm setting up a plugin with a nested shortcode, i.e. [ct_training_group] [ct_training] [/ct_training_group] Here's the catch: I use the [ct_training] code outside of the parent as well as ...
0
votes
1answer
707 views

Using shortcode in template file

this is shortcode in template: function shortcode_frame_left( $atts, $content = null) { return '<span class="frame alignleft">'. do_shortcode($content) . '</span>'; } ...
0
votes
2answers
361 views

How do I create shortcodes for my wordpress themes?

I have seen many professional wordpress themes for sale that have shortcodes built in with which you could easily make posts like this: [alert_box]This is an alert box which based on this short-code ...
1
vote
1answer
382 views

Shortcodes attributes defaults

I use this construction to implement my own shortcode: function column_with_icon($atts, $content = null) { extract(shortcode_atts(array( 'icon' => 'onebit_03' ), $atts)); ...
5
votes
2answers
390 views

How would I create a plugin for my shortcodes?

All tutorials I have found say to add your shortcodes to functions.php in your theme. I would like to break that away from my theme and put that in a plugin so I can share these shortcodes between my ...
0
votes
2answers
145 views

Plugin that provides the [edit] shortcode?

Several months ago, I was browsing around the Internet and came across a WordPress site that had updates on the posts enclosed in [edit]...[/edit]. Obviously this was a function provided by a plugin ...
0
votes
2answers
2k views

How to get shortcode to work inside a foreach loop called within a shortcode?

My plugin, WP Coda Slider, uses a shortcode to get_posts and add them to the slider. If one of the posts contains shortcode the shortcode in that post will not work. $my_wpcodaslider = new ...
2
votes
3answers
438 views

How do I add my own custom shortcodes?

I'm looking to reuse some small portions of html inside several pages/post but I don't know how to obtain this on WordPress. It would be nice if I could have a helper in the editor to include them, ...
1
vote
2answers
183 views

Use shortcodes in terms description? [closed]

Anyone knows a way of using shortcodes on terms description? This is possible?
0
votes
1answer
831 views

How to display a shortcode caption somewhere other than the_content

I want to disable shortcode captions for posts in one of my themes, and display the content elsewhere, such as in a sidebar. The images aren't uploaded to wordpress, but they're linked-to using the ...