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
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
542 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
622 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
983 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
268 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
483 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
842 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
881 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
657 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
248 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
712 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
742 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
340 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
765 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
260 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
4k 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
492 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
671 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
3k 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
475 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
455 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
144 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 ...