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)

3
votes
1answer
642 views

TinyMCE popup windows using WP functions

In my editor I would like to use a TinyMCE generated popup to insert in the textarea some complex shortcodes. I use the TinyMCE API to show the popup (bottom of this question). The popup is a PHP file ...
2
votes
1answer
762 views

Convert shortcode into html form

I want to convert this shortcode. [list-style="one"] a b c d [/list-style] To ouput like this one (html form) <ul class="one"> <li>a</li> <li>b</li> ...
1
vote
1answer
37 views

Adding javascript actions to words in post content

I would like to have my blog run some JavaScript code when certain particular words are clicked on. One approach would be to include "onClick" handlers in HTML elements within the posts and disable ...
1
vote
1answer
30 views

How to Reference/Echo Variable from Another PHP Function

I have successfully set up a PHP function for my blog posts to create a shortcode to automatically display/style an iFrame tag for a YouTube video, as well as pull in the duration and view count ...
1
vote
1answer
83 views

Can I wrap an unordered list inside a shortcode?

So, I created an events page for my client that holds lots of details about events. We found no particular event plugins to be helpful for their purpose, so I built a a custom template using advanced ...
1
vote
1answer
63 views

esc_attr not working in shortcode

I have a shortcode that outputs a block of html. One element in the block is an anchor tag with an image caption in the title attribute. Some of the captions I am using have double quotes in them, so ...
1
vote
1answer
43 views

Shortcode for latest -not expired- posts

I've made a short code (part of a plugin) to display the posts which aren't expired. For saving the expiration date, i made already a meta key called newsbox-date. Handy for micro-news, short ...
1
vote
1answer
232 views

Shortcode are not working in Option tree textarea

I am using option tree. In textarea, i place shortcode [layerslider id="1"] its not working, i also found same post replied by plugin author allow shortcodes in textarea in option tree applied ...
1
vote
1answer
897 views

Audio and video shortcodes not working properly

I'm having some trouble with Wordpress's built-in shortcodes for audio and video. When I embed a video, it basically gives me a black box and has a link to download the file at the top; when I embed ...
1
vote
1answer
200 views

Stray closing paragraph tag when using shortcodes

I'm using a basic shortcode to wrap some text in an expandable div. What appears to be happening is that the wpautop is inserting a stray closing paragraph tag at the beginning and a stray opening ...
1
vote
1answer
406 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
1answer
48 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 ...
1
vote
1answer
131 views

Gallery shortcode numerical sorting

When I try to sort a Gallery created through the [gallery] shortcode by numerical titles I get them sorted in alphabetical order. That means that they are sorted like so: 1, 3, 34, 4, 56, 6, etc. ...
1
vote
1answer
278 views

wp_specialchars and wp_specialchars_decode in a shortcode plugin

I have written my first plugin, a shortcode plugin. I have read about wp_specialchars and wp_specialchars_decode but I'm not sure how to use them. The plugin read a shortcode allowing some parameters ...
1
vote
1answer
136 views

Processing shortcodes in groups (separated by line breaks)?

The Project I'm working on a plugin to resize and embed rows of images using shortcodes that will be converted into <img> tags. In most cases there will be multiple images per row, and the ...
1
vote
1answer
211 views

Raw output (preventing wpautop)

Using WordPress 3.5. I'm trying to put a <form> into a Page of a WP-based site. Unfortunately, WP is "helpfully" screwing up the formatting of the form by inserting <br> and <p> ...
1
vote
1answer
99 views

Single post content custom order

In my post I have a shortcode for [video] than text content. Single post page displays first entry-meta, than title, than content [video] + text. What I need is to add some condition in single.php so ...
0
votes
1answer
29 views

Creating custom shortcode

I'm trying to create some custom shortcode - I want to be able to have names and numbers of people I want to display on my website, but as a shortcode, so it doesn't have to be typed in again and ...
0
votes
1answer
18 views

Input with spaces in Shortcode attributes overwritten by defaults

question seems to be similar to the one asked here but the answer went down a different path. Pretty much if a user enters a shortcode attribute with a space it will get overwritten by the default ...
0
votes
1answer
19 views

Add category attribute to custom recent post shortcode

I have a recent post shortcode to display a custom post. Everything works fine so far. However, I would like to add a category attribute so I can specify which category to display. My working code is ...
0
votes
1answer
67 views

echo do_shortcode for Contact Form 7 from within dynamically loaded php file

I am loading a php file containing echo do_shortcode('[contact-form-7 id="568"]'); using jQuery .load() but the shortcode returns nothing. I have seen this question and answer and understand that ...
0
votes
1answer
32 views

Can't display shortcode in WP_Query loop

I want to display all posts from my CPT brand. My WP_Query loop works well but the shortcode I want to use within it doesn't work. This shortcode comes with some plugin called Download Attachments, ...
0
votes
1answer
22 views

Form processing: How to process form before output and access data from shortcode

I have a form that's output with a shortcode. I need to be able to conditionally process a redirect on the form submission, so the form processing needs to happen before any output is sent (I've put ...
0
votes
1answer
43 views

Create special button on WP Tiny MCE Posts Editor for Shortcodes

I am trying to create a special button on the Tiny MCE editor on the Post Editor of Wordpress. I want to create a button for my created shortcode tooltips. Check out my desired output: ...
0
votes
1answer
18 views

Executing Javascript in Plugin

I am trying to display a google map using short code for a plugin I am building, but I can not get it to work. Does anyone have some advice on this? Here is my code: add_shortcode( 'show_map', ...
0
votes
1answer
28 views

Wordpress Short code with additional parameter

I am using twitter boostrap in my recent project . I want that the post or page content will split into columns. For doing this I am declaring several shortcode like this function ...
0
votes
1answer
56 views

Preserve shortcode content formatting

How can I preserve the formatting of the content within a shortcode block when I switch back and forth between the visual and text editor in TinyMCE? As in, the stuff between [myshortcode] and ...
0
votes
1answer
102 views

Passing postid of Testimonial Custom Post in Shortcode Parameter

I am trying to create Testimonial custom post and display using shortcode function create_post_type() { register_post_type( 'testimonials',//new post type array( ...
0
votes
1answer
63 views

Shortcode Display From Wordpress Dashboard Page Without Using post_id

I have this code for showing recent posts on my home page custom theme and it works well. functions.php code: function my_recent_posts_shortcode($atts){ $q = new WP_Query( array( ...
0
votes
1answer
45 views

Adding shortcode to the main menu

Is it possible to add shortcode to a main menu? I tried the following but no luck? add_filter('wp_nav_menu_items','add_nwadcart_widget_to_menu', 10, 2); function add_nwadcart_widget_to_menu( ...
0
votes
1answer
40 views

How to Modify WordPress Default Image Gallery Shortcode

I would like to be able to show 5 columns and only 10 images per page for the default WordPress image gallery. Visually I would imagine it to look something like the following: columns="5" ...
0
votes
1answer
44 views

On selecting shortcode generate selected shortcode table inside page editor worrdpress

i want to create a different different shortcode while choose particular shortcode relative table is show on page editor for example when user choose [some_random_code_sc] that shortcode then relative ...
0
votes
1answer
57 views

Replace shortcode in substring

I've created these two functions to toggle between the first paragraph of the content and then everything but the first paragraph so when the user selects 'More' it slides out the article smoothly ...
0
votes
1answer
29 views

Redirect loop upon installation of my plugin

I have created a plugin that uses a shortcode [MyCreditStatus] to display a form (multi-page form). This plugin uses an API that I also made. When I try to install the plugin, there are times that ...
0
votes
1answer
68 views

Allow user to input shortcode into wordpress widget

This is my first widget, so I'm new to this, but I want the ability to add 6 different shortcodes to the widget that the user can set. The question is this, how do I get the plugin to allow the user ...
0
votes
1answer
29 views

the_time function inside HTML dom parser

I have recently bought a theme, where I want to modify some things. The theme makes use of shortcodes. One of these shortcodes is adding the most recent posts. In these most recent posts is the date ...
0
votes
1answer
16 views

Is there a way I can return terms by name using a shortcode?

I want to create a shortcode to return a string of values, which are the term names. So I can use it to pass data inside a plugin. Anyone cracked this one before? /** * Custom shortcode to get terms ...
0
votes
1answer
88 views

Including Custom fields within the_content

I’m designing a site for a client and I’m using custom fields for buy links to her books. I only want buy buttons to appear for fields that contain a URL, so I’ve hooked this just below the_content: ...
0
votes
1answer
44 views

TinyMCE strips content while pasting. Possibly a bug

I have a shortcode that has a 'style' attribute for a theme that I'm creating, which looks like this: [shortcode_name type="normal" style="fixed"] Now if I paste this in the TinyMCE editor, I get ...
0
votes
1answer
33 views

How to use extract shortcode in loop?

Actually I need to gallery in any new post so i use shortcode for making gallery for every new post. I use images and videos in slider. problem is that I have custom html slider need to convert ...
0
votes
1answer
115 views

HTML Inside of Shortcode Breaks Shortcode Output

Lots of Googling has still not yielded a solution. Here is the problem: I have created a custom Wordpress shortcode to use inside my Thesis theme. The goal of the shortcode is to allow users to wrap ...
0
votes
1answer
52 views

Space in WordPress Attribute Causing Problems

I'm trying to write my first caption plugin and having some difficulties. I'm setting up a shortcode like so: function Shortcode_Caption( $atts, $content=null ){ // DEFAULT ARGUMENTS ARRAY ...
0
votes
1answer
80 views

Change font-size within a shortcode

I have a simple shortcode like this.... function myshortcode( $attributes, $content = null ) { extract( shortcode_atts( array( 'class' => '' ), $attributes ) ); return ...
0
votes
1answer
161 views

How to get specific string in explode array?

I have a shortcode where I'm trying to get a specific string from the $args array below. Query: <?php $args = array( //'post_type' => $posttype, 'post_type' => explode( ', ', $posttype ), ...
0
votes
1answer
1k views

Wordpress removing <p> tags?

I'd already come across a case where Wordpress added <p> tags. However now I'm dealing with the opposite situation. When I add [] shortcodes inside <p> tags WordPress automatically removes ...
0
votes
1answer
21 views

Activate short codes for all post queries?

I need to use shortcodes on widgets and various plugins. For widgets I simply used: add_filter('widget_title', 'do_shortcode'); add_filter('widget_text', 'do_shortcode'); However I cannot figure ...
0
votes
0answers
51 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
0answers
43 views

Run function from parent on child site

I'm running a Multisite WordPress installation and have a couple of child sites. I'm trying to run a script from the main page on one of the child sites. It can be a shortcode [pro_display_zone ...
0
votes
0answers
176 views

Creating a costing calculator plugin. How can the user create the calculations without coding?

I am relatively new to php & wordpress development. I am trying to create a plugin that allows the user to create an unlimited number of costing calculators. Users will be able to add fields ...
0
votes
0answers
58 views

How can I join the two key with the two value of a custom field?

I am using wp add custom field with images and text multiple time .. how can join to have the key and value in the same div ? <div id="Caption-custom" class=""> <?php $text = ...