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
1answer
123 views

Shortcode returns values in the wrong order

I have a shortcode function that returns: return '<ul class="list-pages">'. wp_list_pages( $args ) .'</ul>'; Of course it returns: {pages} <ul class="list-pages"></ul> ...
0
votes
1answer
305 views

Multiple Content Shortcodes

I was trying to create a shortcode for a multiple tabs panel. The user can set the number of tabs, the titles and the content for each. It would be something like : [tabs number='4'] [tab ...
-1
votes
1answer
851 views

Changing the title tag from a shortcode

I currently have a shortcode which dynamically swaps out locations on a page to make each page specific to a location. For example the url http://mywebsite.com/offers/scotland/ Would make the H1 ...
-1
votes
1answer
761 views

Calling function from within functions.php returns unwanted value

I am trying to customize the output of the [gallery] shortcode to include comment count by this plugin: Facebook Comments for WordPress plugin I found a function by Zack Austin (shown below) that ...
0
votes
2answers
966 views

Populating shortcode values dynamically in theme template

I'm trying to use a jquery toggle shortcode in a theme template. The shortcode goes like this: [sws_toggle3 title="Title"]You can now see the displayed text.[/sws_toggle3] I want to pull posts ...
0
votes
1answer
221 views

Rename Smart YouTube's httpv back to http for all posts

I've used the Smart YouTube plugin to embed YouTube videos into my blogs. The way I did it is to replace the http:// of the YouTube url with httpv:// as the plugin describes. But now I noticed that ...
1
vote
3answers
367 views

Custom CSS for plugin form

I have a short code that is adding a form to a page. How do I ensure that the CSS for the form is loaded in time with the shortcode?
2
votes
1answer
168 views

Create a shortcode in Wordpress, again

There're lots of examples both here and on the internet, I've tried but don't seem to be able to achieve what I need although it does feel like it should be simple enough. Basically, I want to be ...
1
vote
1answer
622 views

Help with shortcode in admin-ajax [closed]

I've been playing around with ajax in wordpress and I've gotten my efforts to work on both back and front-end without too much trouble, however I've run into a problem getting post shortcodes to run ...
0
votes
1answer
86 views

Wordpress Shortcodes - Optional Styles

i'm creating some custom shortcodes for my wordpress theme. Shortcodes are by nature optional on pages/posts, but may contain css, js or other files. My question is, how can i enqueue css styles ONLY ...
0
votes
1answer
103 views

loop on page makes shortcode fail

I have this typical WordPress page (page.php): <?php the_post(); ?> <div id="rightcol"> <div <?php post_class(); ?>> <?php the_content(); ?> </div> All works ...
0
votes
1answer
710 views

Help with Wordpress function inside a shortcode

I'm trying to spice up a theme of mine with some shortcode buttons but I'm having quite a bit of trouble when trying to call the author's name within the button itself. I tried simply including ...
1
vote
1answer
2k views

How do I hardcode a WordPress shortcode into my theme?

I am using WooTheme's Canvas theme and would like to "hardcode" in the [post_comments] shortcode into my theme. [post_comments] displays a comment link with comment count (ie Comments 10) in my post. ...
0
votes
2answers
2k views

Wordpress Shortcode wrap around div

Is there a way to wrap a wordpress shortcode around a div in a template file? Here is my code: <div id="subscription"> <?php do_shortcode('[subscribe]');?> <p>This is subscription ...
0
votes
3answers
2k views

Ajax, filters and shortcodes

could you figure out why I'm unable to get shortcode filters applied in ajax inclusion of posts? Let me explain better: I've managed to include a post from within another post, through ...
0
votes
1answer
651 views

WordPress wpautop/shortcode generating invalid markup

I notice that theres invalid markup in my shortcode. Its ok if I disable wpautop tho function shortcode_banner($attrs, $content = '') { echo ' --- ' . $content . ' --- '; $html = '<section ...
0
votes
2answers
543 views

Echoing function into Wordpress NextGen gallery

Is there anyway to echo a function into a wordpress shortcode? heres my code: <div id="subscription"> <?php echo do_shortcode('[nggallery id=$ID]');?> </div> $ID is a function ...
4
votes
1answer
627 views

explode array within shortcode

This functions at the moment but it only returns the first value from the array. I've been struggling to echo, print, explode, or whatever the multiple custom field values that share the same key ...
0
votes
2answers
323 views

how to write short code in word press

I am new in WordPress, I want to write short code with parameters in function. That is in add_shortcode('short code name','function name','parameter1,parameter2'); In add_shortcode(), I want to ...
26
votes
7answers
10k views

Conditionally Loading JavaScript/CSS for Shortcodes

I released a plugin that creates a shortcode and requires a JavaScript file and a CSS file to load on any page that contains that shortcode. I could just make the script/style load on all pages, but ...
1
vote
1answer
326 views

May i Use ShortCode in Template?

Am Using Wordpress Blog.Here i want Use Tweetmeme Plugin.I want to show the output of the Tweetmeme Plugin to Customizing place(Side of the Post[Not Before or After]).The Plugin Creators are providing ...
1
vote
2answers
1k views

How can i remove the paragraph from shortcodes content?

If you have created shortcodes in Wordpress, you may have noticed that when you get the content of your shortcode, it's wrapped in html paragraph tags. I don't know why the progammers did that. It ...
0
votes
2answers
186 views

Is there a straight-forward way to iterate over all shortcodes in a post?

I'm working with a shortcode [translate lang=eng]Apple[/translate] which will be shown only if the "current language" is eng. If the post contains, in addition to the above, the declaration [translate ...
6
votes
3answers
4k views

Check if post/page has gallery?

I'd like to run some code only if a gallery (inserted with the [gallery] shortcode) has been inserted into a post/page. I did the following: gallery_shortcode($post->ID) ? $gallery = 1 : $gallery ...
0
votes
3answers
991 views

Insert PHP code via shortcode?

I wanted to insert a form with a line of PHP code via shortcode. I am wondering if it's allowed? Has anyone tried it? Take the following for example: function get_form($atts) { return '<form ...
2
votes
1answer
269 views

How can I just get content inside a shortcode or just outside

Suppose I have content like [xxx] Here is some content in xxx [/xxx] Here is content outside xxx ... Can I somehow just get content inside [xxx] ONLY content outside [xxx] ONLY
0
votes
1answer
147 views

post var problem with shortcode loop

I have a function to display the children of the page in the sidebar php file using wp_list_pages: global $post; ?>        <div id="subChildren">        <?php if($post->post_parent) ...
1
vote
1answer
1k views

Can shortcodes contain conditional statements? Even without them my shortcode renders blank page

The following code is supposed to allow for a shortcode that includes many attributes, but not all of the attributes may always be present in which case I do not want the containing element to show ...
0
votes
1answer
486 views

Trouble passing attribute into shortcode function

For some reason the WP_Query instance in my shortcode function won't take the query attribute sent from the shortcode. The shortcode is like this: [postlist query="post_type=any&posts_per_page=5" ...
1
vote
2answers
414 views

Inserting shortcode [stream /] into a Text widget

hi i'm trying to insert a short code into a Text widget but all its doing it showing the code and not processing it. <?php echo do_shortcode(' [stream embed=false share=false width=500 height=560 ...
0
votes
1answer
844 views

How to add shortcode to show/hide press releases?

Is it possible to create a TinyMCE button and shortcodes to WordPress to enclose press releases in, so that they're hidden by default, but at the press of the button, they would expand to reveal the ...
3
votes
1answer
892 views

do_shortcode() doesn't do shortcodes ;)

Imagine this basic shortcode in your functions.php file: function div_shortcode( $atts ) { return '<div class="div"></div>'; } add_shortcode('div', 'div_shortcode'); So every [div] ...
1
vote
3answers
2k views

Any Short code Availble for Get Post List With Thumbnail Plugin?

Any Short code Availble for Get Post List With Thumbnail Plugin? or else how to Create Short code for this Particular plugin? Thank u in Advance.
0
votes
1answer
460 views

Better way to display multiple plugin output on the same page?

Using two plugins on one page; promoslider & events list. Tried to produce desired output. +-----------------+ | slider output | +-----------------+ Text related to events list ...
0
votes
1answer
3k views

Turn off image captions in gallery view?

I've set up my loop-attachment.php to show the gallery of thumbnails above the main, selected image using this code from the WordPress Codex: <?php $gallery_shortcode = '[gallery id="' . ...
2
votes
1answer
658 views

nested Shortcode doesn't work

Shortcode: [permalink][title][/permalink] Output: <a href="foobar">[title]</a> Wordpress shortcode API sais, it's correct: http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes ...
1
vote
1answer
417 views

Create own Wordpress shortcode gallery

How I can handle this shortcode: [my_gallery] img01.jpg img02.jpg img03.jpg img04.jpg [/my_gallery] I can't understand how to write a function, to handle image files name.
0
votes
1answer
106 views

Pulling RSS from site and display it in posts

I'm trying to pull rss from sites similar to this: http://andreabadendyck.blogg.no/ I have several posts with the URL in the title, so I can pull the URLS from here and hardcode the rss reader in the ...
-1
votes
2answers
250 views

Embedding BitBucket Code in Posting

I want to embed my code at BitBucket in wp post, anyone can suggest me, a good plugin or anytrick to do it?
3
votes
5answers
2k views

Cannot strip JW Player shortcode?

On the WordPress archive template I am using a custom excerpt function that includes a reference to strip_shortcodes(). For some reason, shortcodes are being rendered and displayed in the archive. ...
0
votes
1answer
714 views

Replacement for gallery_shortcode function not taking all attributes

I have the following custom function to replace the gallery_shortcode function from core. It hooks in at the beginning and works. The problem is that I can't get my custom key/values from the ...
0
votes
3answers
403 views

append stylesheet via shortcode

Wondering how I can add a stylesheet to wp_head section via shortcode, since shortcodes are parsed after wp_head, I've hearing about output buffering but I Am not sure. Any idea?
0
votes
1answer
748 views

Prevent wordpress from rendering shortcode in post

Suppose I have a [list] shortcode. I want to have a post explaining how to use shortcodes (docs for my theme). How can I have a header like [list type="arrow"] Shortcode Tag Currently wordpress ...
2
votes
3answers
2k views

Creating a table from shortcode avoiding wpautop for each row

I'm probably doing this all wrong, and there'll be a much simpler solution. Basically, I'm trying to build a table of tour dates that'll be editable by someone with little technical knowledge, but can ...
3
votes
1answer
1k views

Shortcodes, HTML tables, and multiple rows

Im trying to build a shortcode which calls an HTML table with a fixed number of columns and a variable number of rows depending on the context. Its hard to manage — or even build, multiple ...
1
vote
1answer
4k 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
342 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
376 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
770 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 ...