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

Add number in increment of one to DIV ID

I'm using a shortcode to display a custom post type. The shortcode contains an attribute to display only posts of a specific category within the custom post type e.g. [faq category="travel"] For each ...
1
vote
1answer
290 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
1answer
65 views

Display gallery on bottom after content

How to execute the gallery shortcode after any other content no matter where the shortcode is in the post HTML? Thanks.
0
votes
0answers
95 views

Str_replace using shortcode with multiple changes

I am using a feed importer plugin which gives the option to use a short code in case I need to change data (in this case data for a custom field) on import, using for example: ...
0
votes
1answer
99 views

How do i display the built-in gallery inside a widget?

I want to display a specific gallery (without a plugin = WordPress built-in gallery) inside a widget. I tried the shortcode [gallery ids="717"] but that doesn't work. Maybe a workaround could be ...
0
votes
1answer
127 views

Custom field within shortcode

I'm currently using the 'WP Simple Paypal Shopping Cart' plugin to get up a simple paypal e-commerce site, it's super easy to use, but to save the client having to write shortcode, I've set up custom ...
1
vote
1answer
162 views

IF statement in a do_shortcode

Is it possible to do a if statement in a do_shortcode? <?php echo do_shortcode("[table width='500'] " . if ( have_posts() ) : while ( have_posts() ) : ...
0
votes
0answers
167 views

Filter “Awesome Filterable Portfolio” Plug-In to Display a Specific Category by Default

I am using the "Awesome Filterable Portfolio" Plug-In. You are supposed to put the short code on whatever page you want the portfolio to appear: [af-portfolio] The portfolio does appear with the ...
0
votes
0answers
14 views

Nested shortcodes? [duplicate]

What’s the best way to pass one shortcut result to another a.k.a shortcut nesting? Trying to pass a Geo Locator plugin variable return from this plugin http://www.wp-geolocation.com/ to the search ...
0
votes
1answer
58 views

Executing a shortcode at the top of PAGE template?

I need to execute a shortcode at the TOP of contents area in specific PAGE template. Notice that I'm talking about "pages" as there are lots of plugins for 'posts' Preferably inserting the shortcode ...
0
votes
2answers
34 views

Custom field in a shortcode?

I cannot get the image from one of my fields into a shortcode. (it works with get_the_post_thumbnail($post->ID, 'thumbnail') but I need the value from the field udstiller logo. function ...
0
votes
2answers
116 views

unwanted P tags in shortcode, delay wpautop not working

Like others, I'm having issues with WP adding unwanted p tags in my code. I have a shortcode I created that is to simply just spit out my javascript and html when I use it. Everything works fine ...
-1
votes
1answer
175 views

custom post types shortode stays on top of other page contents. Is there a bug?

I have created a custom portfolio post type for my wordpress theme, and I have made a shortcode for it too. But when I create a page and use the shortcode to display limited number of my portfolio ...
0
votes
1answer
76 views

Turn a snippet of HTML and PHP into a shortcode

the code is <div class="huili-relevant-left"> <a href="<?php echo get_post_meta($post->ID,"taobao_value",true);?>" hidefocus="true" target="_blank" ...
0
votes
1answer
46 views

How can I achieve this, using shortcodes

I have a plugin that restricts contents for registered users only, on the other hand I have created a shortcode for showing a chat and I want to hide it using the restrictive shortcode; ...
0
votes
1answer
232 views

Shortcode strips formatting and returns at content top

Using the Advanced Custom Fields plugin and I've got a shortcode going for a repeater field, but it returns the list at the content top. I changed it from an echo to a return, which I understood would ...
0
votes
2answers
32 views

div having different appearances in different themes

I have a shortcode in a plugin that is supposed to display a div. The div can be styled in the settings. The problem is: the div has different appearance in different themes. This obvious is caused ...
1
vote
0answers
84 views

Add button to kitchen sink toggle

I have created a simple function along with a shortcode, my goal is now to add a button in the sink toggle of wordpress so that the user doesn't have to type anything. Is this hard to achieve? how ...
0
votes
1answer
154 views

do_shortcode within a shortcode

This may sound a little confusing but I'll try my best to explain. I've made a shortcode that grabs the content of a post (when given the id), it looks like this: $post_id = $id; $queried_post = ...
0
votes
0answers
24 views

php within a shortcode within php

I've been trying for ages to get this work, but to no avail! Any help would be greatly appreciated. <?php echo do_shortcode("[thumb]'".bp_profile_field_data('field=3')"'[/thumb]"); ?> ...
0
votes
1answer
24 views

Custom shortcode that writes to file

I'm trying to maybe do too much in a shortcode call. Here's the code I have: //[rand] function randnumber_func( $atts ){ $digits = 4; $randnumber = rand(pow(10, $digits-1), pow(10, ...
0
votes
1answer
60 views

How to print [embed] code in wordpress [duplicate]

I would like to print the following code in wordpress. [embed]http://www.youtube.com/watch?v=9bZkp7q19f0[/embed] But every time I use that code in the wordpress editor, it automatically embeds the ...
0
votes
3answers
262 views

shortcode for recent custom type post

I'm not a coder so I may have done some "coding" crimes, apologies. I've bought a theme who has shortcodes for last posts but not for last "custom post type". So I tried to create last "custom post ...
0
votes
0answers
94 views

Dynamically load JJ NextGen Slider/ Slideshow (dynamically add shortcode with jquery)?

My front page includes an image slideshow by JJ NextGen Slider (Link). Therefore I am using PHP and do_shortcode(). This is the full code: <?php echo do_shortcode('[jj-ngg-jquery-slider ...
0
votes
1answer
1k views

Auto Gallery from folder contents

I need to be able if this is possible, (i am a newbie at this so please take that into consideration) I want to create a Wordpress shortcode that will add an automated gallery of the contents in a ...
1
vote
1answer
116 views

Are shortcodes case-sensitive?

If I write a plugin and register a shortcode using this code: add_shortcode('footag', 'footag_func'); and a user uses this in their post: [FOOTAG] Is it supposed to work?
0
votes
1answer
85 views

Display only posts with comments

I have this code to show recent posts from one category. I need to show only the posts which have comments. How can i do that via shortcode? /* Shortcode to output recent posts from one category */ ...
0
votes
2answers
365 views

Create shortcode for list of custom post titles with custom fields alongside

I'm stumped. I've looked at various sites but haven't found the exact code I need. Basically I want to create a list of custom post titles with the date from one of the custom fields for that post ...
0
votes
1answer
165 views

tiny_mce_before_init preventing custom shortcode icon appearing

I'm using the following to trim the TinyMCE editor // Restrict buttons on the rich text editor function formatTinyMCE($in) { $in['remove_linebreaks'] = false; ...
0
votes
1answer
118 views

Changing layout of defaul gallery output to masonry

I'm changing the default layout for gallery shortcode. I have this in my functions.php: $attr['columns'] = 1; $attr['size'] = 'full'; $attr['link'] = 'none'; $attr['orderby'] = 'post__in'; ...
0
votes
1answer
337 views

Shortcode in AJAX popup

I am trying to use a shortcode from Ultimate Facebook plugin to display a FB connect button in an AJAX popup and can't seem to get it work properly. I searched and used the solution given by djb in ...
1
vote
2answers
917 views

Redirect function inside a Shortcode

I am developing a free plugin for connection a external support system to WordPress to be able to authenticate users on WordPress. For this, currently from the external system, the user is sent to ...
0
votes
1answer
300 views

Wordspress add <p> into my javascripts

I use a slider called revoslider and use it via shortcode. When i use the shortcode and do not use visual editor for insert and save, the slider does not work because WordPress adds <p> into ...
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 ...
0
votes
1answer
128 views

Front-End Form Submission in Shortcode

The plugin I am working on contains shortcodes with forms on them. Upon form submission (POST), I do some database work, and then planned on redirecting to another page after the db work is complete. ...
0
votes
2answers
322 views

how to remove filter from wordpress shortcode output

Twitter URL plugin add the filter to the_content. This filter messing up the output of my plugin shortcode output. So I wish to remove this filter only for my shortcode output. ...
0
votes
0answers
55 views

Adding shortcode field to edit gallery / Gallery Settings

I want to add a field to the Add Media / Edit Gallery / Gallery Settings column which is able to accept shortcodes. I want to do this so that I can add a Cart66 shortcode which will "render" an add ...
1
vote
1answer
35 views

Plugin Handle URL With Custom Theme

I need to develop a plugin in which a special page needs to be created. This page will have a completely separate design from the rest of the website, and will be located at a specific URL. I realize ...
0
votes
2answers
77 views

Shortcode / plugin with custom (flexible) output

Following scenario: I'm building a theme framework which I want to reuse in various themes of mine. In this framework there is a collection of many shortcodes. For exemplary illustration of my ...
0
votes
0answers
62 views

Custom field for default gallery

How I can add custom field in default WordPress gallery? in visual editor and in shortcode.
0
votes
1answer
167 views

What makes a placeholder resizable in Tinymce?

It's not that hard to make a plugin to TinyMCE, similar to what the Wordpress gallery is doing in WP 3.5. Unfortunately, these custom placeholders are always non-resizable, although they show the ...
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 ...
2
votes
3answers
310 views

Nested shortcodes

I'm using 2 plugins in my wordpress blog - WP-Members and Dropbox Folder Share. I want to do something like this: [dropbox-foldershare-hyno link="[wp-members field="some_link"]" ver_como='lista'] ...
0
votes
2answers
58 views

How to handle shortcodes through plugin

I learned that I can only put in the code for handling my shortcode through the theme's functions.php But I was thinking of making it a plugin rather than a theme. How can I achieve that?
0
votes
0answers
48 views

Can't seem to get [shortcode]s to work

function register_shortcodes(){ add_shortcode( 'my_shortcode', 'my_shortcode' ); } add_action( 'init', 'register_shortcodes'); function my_shortcode( $atts ) { return "--my_shortcode--"; ...
0
votes
1answer
119 views

<?php wp_register(); ?> Display logged in user as “Site Admin” apposed to Logged in user

I'm just working on a little hobby word-press site I have; <?php wp_loginout(''); ?> <?php wp_register( '',''); ?> In the top rite corner of my site, <?php wp_loginout(''); ?> ...
2
votes
3answers
546 views

Shortcode adding p and br tags

I apologize as I realize this has been asked before and I believe the issue is with wpautop function adding closing p or br tags but every solution I've found has not worked so I'm at a loss for ...
3
votes
1answer
1k views

What does extract( shortcode_atts( array( do?

The codex says shortcode_atts() combines user shortcode attributes with known attributes and fills in defaults when needed. The result will contain every key from the known attributes, merged with ...
-2
votes
1answer
28 views

Shotcode error on functions

Hello i have this shortcode that is generating a error. Can someone help? add_shortcode('do-action', 'do_action_shortcode'); function do_action_shortcode($atts, $content = '') {   ob_start();   ...
0
votes
2answers
113 views

How should I approach changing the template & $query as part of a shortcode's execution?

I am working on a project where I need to be able to change the template being used if a given shortcode is used. To complicate things more, the plugin must also be able to rewrite $query if this same ...