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
145 views

How to return multiples lines in a shortcode?

I found this example of a shortcode on the Internet: function project_shortcode( $atts, $content = null ) { extract( shortcode_atts( array( 'class' => '', 'id' => '', ...
1
vote
2answers
1k views

Short code to display a loop

I've been working on this shortcode w/o any success... function loop_shortcode( $atts = '' ) { '<div class="clear"></div> <div class="childs grid_12"> <?php $the_query = new ...
1
vote
3answers
342 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?
1
vote
3answers
1k 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.
1
vote
2answers
582 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 ...
1
vote
2answers
27 views

(solved) how to have the gallery shortcode output one single UL list instead of several DL?

I need the built-in gallery shortcode to output UL instead of DL. How can I do it? I know I can use the 'post_gallery' filter, but that means almost duplicating the media's gallery_shortcode function. ...
1
vote
1answer
22 views

How can I whitelist only specific shortcodes for processing in text widgets?

I know that I can use the following filters to enable processing of shortcodes in Text Widgets: add_filter( 'widget_text', 'shortcode_unautop'); add_filter( 'widget_text', 'do_shortcode'); How can ...
1
vote
1answer
61 views

Hide Default Video Shortcode Controls on PageLoad

In wordpress 3.6+ when we use default video shortcode [video], controls of video are always visible on pageload. How can we hide these controls on page load and show only when we hover over the video ...
1
vote
1answer
77 views

has_shortcode() - how to detect nested shortcode

I'm using has_shortcode() to detect a shortcode, it works but not at all. If I put this specified shortcode inside another one the has_shortcode() function stops working. has_shortcode( ...
1
vote
2answers
148 views

Remove images from get_the_excerpt

I'm using a custom function to create a shortcode that displays the latest blog post on the home page of a template. But I'm trying to NOT have it display any images. I know I can use the Advanced ...
1
vote
2answers
61 views

Optimizing Query used for a Shortcode

So, I have this shortcode that produces a list of all published multisite and their pages. The network in question has about 50 sites in it. The problem is that loading the page I put the shortcode on ...
1
vote
1answer
90 views

Shortcode inserts paragraphs before and after executing shortcode

When my shortcode is executed, it inserts a <p></p> before and after the shortcode. My shortcode is the only thing in the text editor of the page. There is not a newline before or after ...
1
vote
1answer
150 views

How to insert image and text from admin panel throughout my theme

I'd like to have an admin panel where I can upload an image and customize a line of text. Then use a shortcode throughout the theme to display the text/images. I'd also like this to be scalable so I ...
1
vote
1answer
113 views

Getting the count of a shortcode that is nested

Let's say I have nested shortcode where the outmost shortcode is just HTML but the inner one is the one who displays the data. [outer_shortcode][inner_code url="#" title="Hello"][/outer_shortcode] ...
1
vote
2answers
316 views

Run shortcode at certain resolution

I've gone a roundabout way of trying to ask a question about this here: Loading shortcode with ajax but figured it might be worth asking the fundamental question of what I am trying to do without ...
1
vote
1answer
31 views

How do I write this shortcode? [closed]

I have this shortcode, I would like to write in a better and clean way: function webhosting_products_shortcode( $atts, $content = null) { $content='<h2 class="heading_blue">Eburnie Hosting ...
1
vote
1answer
287 views

Add category attribute to custom shortcode

I have created a custom post type called "faq". The custom post type uses categories. I have created a shortcode [faq] that displays all the faq posts. What I would like to do is add an attribute to ...
1
vote
2answers
37 views

Secure Pages Best Practice

I am in process of writing a plugin that has front-end shortcodes that display a user's information/data. If the user is not logged in, I need to redirect to a front-end login page/form. What would ...
1
vote
1answer
35 views

Allow users of my plugin to define their own shortcode rather than use mine?

I'm creating my first plugin. So far everything is great, but my shortcode is something like this [BIMS] and that acronym might not be easy to remember, or appeal to everyone. I'd like to include an ...
1
vote
1answer
56 views

Showing a different gallery in a seperate post

i am using the [multigallery] function and I was wondering if there is a way to use the function to call attachments from another post. For example if i was writing a post about taylor swift and I ...
1
vote
1answer
488 views

Why are you using add_action for shortcode?

I would like to create shortcodes, some tutorials write about to use add_action add_action( 'init', 'register_shortcodes'); but I read tutorials where the author didn't use it, only put ...
1
vote
1answer
243 views

How to use shortcode attribute in separate function

I'm working on a WordPress site and have installed a slider plugin that registers a slider on the backend (or multiple sliders) and then displays it on the front end with a couple of simple php ...
1
vote
2answers
2k views

How to get gallery id inserted to a post?

Is it possible to get a specific Gallery ID inserted to a post in wordpress 3.5? I want to load gallery from post using Ajax. I use shortcode [gallery] to do it. But when I use it this way: echo ...
1
vote
1answer
44 views

Create a shortcode that creates a form for users to edit their information

I want to make it so that logged in users can edit their information on a page in my site, so that I can avoid having them go to the admin side all together. I was thinking that I could create a ...
1
vote
1answer
164 views

Shortcode output appears before post body [duplicate]

Possible Duplicate: short code output too early How can I insert my plugin code via shortcode inside post body in exact position? The problem is that wp engine inserts the plugin code ...
1
vote
1answer
1k views

Adding Shortcode to Text Widget

At the moment, I'm running WordPress v3.2.2 (soon to upgrade to v3.4.2), and am trying to insert shortcode to insert Issuu into a text widget on our sidebar. The WordPress plugin I installed and am ...
1
vote
1answer
158 views

How to display posts by current user in a drop down

I am trying to write a shortcode that works in conjunction with Contact Form 7 to display the current user that is logged in posts. I have been able to get it to work with regular posts using this ...
1
vote
3answers
481 views

shortcode_atts - one URL variable not working

I have devved a small plugin based on a shortcode. Here's a stripped down version of the code for the shortcode itself: function lishortcode($liatts) { extract(shortcode_atts(array( "li" ...
1
vote
3answers
872 views

Getting attribute value from shortcode

I have this shortcode [learn_more caption="something here:"] [/learn_more] I want to extract the caption value and remove other stuff. "something here:" This is the code that I have, but it ...
1
vote
3answers
491 views

Caption shortcodes not including caption as attribute

I recently installed the bonpress theme and am having trouble with the captions showing correctly. The more I try to understand how captions are supposed to work in Wordpress, the more I suspect ...
1
vote
1answer
716 views

echo do_shortcode is not working on theme's template

I don't know whats causing the problem but the echo do_shortcode is not working on my theme's template, but its working on my plugin's template and the shortcode is working on my posts and pages. ...
1
vote
1answer
225 views

Adding option to Gallery shortcode

just starting out in WP dev, and I'm looking for any guidance I can get. What I'd like to do is use a hook or filter to add my own option to the core WP gallery shortcode. I would want it to work just ...
1
vote
2answers
215 views

How to split <p> text text text </p> into array

I like to output and style in a shortcode, but the content that is get is the content of a page, so it's style like that <p>2012-12-12</p> <p>2012-6-23</p> ...
1
vote
1answer
976 views

add_shortcode() not working inside of function

I have a custom post type bhour, with a field bh_shortcode. When a post of this type is saved, I'd like it to add a shortcode based on the post's value of bh_shortcode. If the value of bh_shortcode ...
1
vote
1answer
119 views

conditional tags- how to use with shortcodes

I have a salon website with a gallery page wherein the user must first select a stylist prior to viewing their individual gallery. I planned on using NextGen to house the images in stylist specific ...
1
vote
1answer
739 views

Gallery shortcode - change link file image size? (not using default fullsize image)

I am using this for my gallery - <?php echo do_shortcode('[gallery size="gallery-thumb" link="file"]'); ?> and I am using the jquery fancyapps fancybox. But some full-size images that are in ...
1
vote
1answer
65 views

no content after shortcode

I hope you guys can help me with this little bug I've encountered. I am using a shortcode to display an audio player in the entries. This is the code i've put in my functions.php: function ...
1
vote
1answer
119 views

How to get rid of shortcodes in post content once and for all

I changed theme/plugin now the post content still display shortcodes. There are some tips around on hiding them, but everytime I use some content functions, the shortcodes shows up again. Also, my ...
1
vote
2answers
365 views

Google Map Shortcode for Custom Taxonomy/Post Types

Calling all WP Stack Exchangers! I am currently using Alain Gonzales' Google Map Shortcode plug-in on a site I'm developing, and it's worked just fine: Google Map Shortcode plug-in on wordpress.org ...
1
vote
1answer
2k views

How do I get the attributes of a short code from a post?

I am trying to preview a NextGen gallery on my main page (and category pages) to show a single image from the gallery on the main page next to the text from the post that normally shows up. I have ...
1
vote
2answers
2k views

How to prevent tinymce macro from inserting nbsp;?

I've got the following macro button defined to wrap a selection in a shortcode in the wp_editor visual editor: (function() { tinymce.create('tinymce.plugins.ingredient_name', { init : ...
1
vote
1answer
753 views

How to put JQuery/Ajax inside shortcode?

The purpose of this plugin is to create a list that users can modify with up or down votes. The shortcode is supposed to display the list on a page and use JQuery to fadeIn and fadeOut while updating ...
1
vote
1answer
219 views

Displaying terms based on loop posts?

I have a shortcode that shows a loop for a custom post type: while ( $loop->have_posts() ) : $loop->the_post(); // do something endwhile; Some of the posts are in categories ...
1
vote
1answer
387 views

Possible to display posts containing a short code ?

i have some posts with a certain shortcode in them. unfortunately these posts are in different categories and contain different tags so i am not able to query them. is it possible that i run a query ...
1
vote
2answers
5k views

Include PHP file in Content using [shortcode]

Here is what I have I am not having any lucking finding how to simply include a file in the content editor using a shortcode. For Example if I wanted to include form.php inside my Contact Page how ...
1
vote
1answer
45 views

Shortcode help: If no image entered take default

I have a shortcode that creates an "opinion box". The user should insert 4 parts the title the images the opinion side of the image in relationship with text i want to check if no image was ...
1
vote
1answer
914 views

get_the_content(“more…”) returns full text

I'm creating shortcode [latest_post] and want to show post date, title and short content. (content has "more" separator). Here is code: function shortcode_latest_post() { global $post, $more; ...
1
vote
1answer
67 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.
1
vote
1answer
569 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 ...
1
vote
2answers
458 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 ...