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
0answers
31 views

WBR (word break opportunity) elements being inserted into shortcode $content in posts

Greeting all, I've written a simple WordPress shortcode which wraps inline $content in <code> tags. I see that sometimes the $content contains <wbr /> elements, which must be inserted ...
0
votes
1answer
184 views

I dont want to show shortcode in <pre> tag

I have a theme and I want to show vistors how shortcode format is in <pre> tag. But when I add shortcode in <pre>, it shows what shortcode does. I just want to show shortcode format in ...
1
vote
2answers
279 views

How to parse nested shortcodes?

The nested shortcodes won't parse correctly: [row] [col size="6"]...[/col] [col size="6"] [row] [col size="6"]...[/col] [col size="6"]...[/col] [/row] ...
0
votes
0answers
53 views

Shortcodes Ultimate pulse my widget in sidebar

I have create my website with sidebar is good for along time. In the recent day, I activate shortcodes Ultimate plugin with my website. I love this shortcodes but It effect with widget in sidebar. It ...
0
votes
1answer
43 views

How do I make a shortcode?

Learning as I go... I have this functionality built, but I need it as a shortcode. How do I do that? $args = array( 'taxonomy' => 'product_cat' ); $terms = get_terms('product_cat', $args); ...
0
votes
0answers
36 views

How to escape shortcode content? Do I even need to escape or validate?

I've written a small shortcode that wraps it's content into a HTML element, like so: [my_shortcode]The sun is shining today.[/my_shortcode] In my shortcode function, I basically return the string ...
0
votes
1answer
61 views

Problems making shortcode with custom post types and taxonomy

I have a custom post type work-gallery and a custom taxonomy use which serves to categorize the posts. I am trying to develop a shortcode which enables me to output the work-gallery posts that belong ...
0
votes
1answer
267 views

Shortcode return $content vs do_shortcode($content)

I think the title of my question says it all. When creating a shortcode, I've seen some people do do_shortcode($content) instead of $content. What is the difference? Another thing, let's say I have ...
0
votes
0answers
194 views

Shortcodes in widget titles: attributes include quotes which are html encoded, why?

I wrote a shortcode plugin that works with widget titles. So I added shortcode support to widget titles like this: add_filter('widget_title', 'do_shortcode'); So my shortcode looks like this: ...
0
votes
3answers
449 views

shortcode in a custom metabox

I am trying to add a shortcode from a plugin to my custom metabox. I have read it isn't the done thing but in this case i do need it to work. The client might not add a video but might add an image ...
1
vote
1answer
75 views

Videos via the video shortcode are always 640px wide?

I've run into a particular problem with the Video Shorcode of WP. I can't seem to change the size of the player with the attributes of the Shortcode. This happens on multiple sites with multiple ...
0
votes
1answer
75 views

How to add source code into wordpress post really?

Ok, I have read and followed the instructions as written in this link: http://en.support.wordpress.com/code/posting-source-code/ I have tried all other the solutions, including reinstall the whole ...
0
votes
0answers
64 views

restrict access to specific urls on a specific period of time

I have a countdown timer plugin which is set do redirect the user to a specific permalink after the time is elapsed. I've added a countdown timer here : mywebsite.com/mypost which is set to 3 days ...
0
votes
1answer
155 views

shortcode not working

I m working on content-product of woocommerce and doing shortcode in the template as echo do_shortcode ('[product_attribute attribute="Grams"]'); where Grams are in my backend as attribute and it ...
1
vote
2answers
609 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
240 views

enqueue script only if it is not already enqueue

I want to include a script in a shortcode output, so I am trying this: function my_shortcode( $atts, $content = null ) { extract(shortcode_atts(array( 'title' => '', ), ...
0
votes
1answer
46 views

How can I put a custom field as the link of a button shortcode?

I have been working on a custom page template, and cannot seem to figure out how to have a custom field for URL's as the link for a button in the loop. Here is my code <?php echo ...
0
votes
0answers
78 views

Clarify: Enqueueing scripts within shortcode only loads in footer?

Each time I enqueue scripts inside the shortcode handler, it ends up in the footer. It doesn't matter whether I register them first and set it to load in the header, if I enqueue inside the shortcode ...
1
vote
2answers
71 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 ...
0
votes
0answers
6 views

Shortcode executing order wrongly [duplicate]

Is there any order an short code should execute? When i inserted it at the end, it is shown at the beginning of the post
0
votes
1answer
42 views

call widget from within shortcode

I have a shortcode in my functions.php which runs a query on a category. I want to have a twitter feed on this particular page. I have a javscript option working on my page for twitter right now but ...
0
votes
1answer
172 views

Using Custom Post Meta Values in Shortcode

I'm trying to display meta content from a custom post type in a shortcode. I'd like to simply provide a post_id and be able to display all the meta content. [my_shortcode post_id=""] I'm new to PHP ...
0
votes
1answer
186 views

Get attributes of nested shortcodes

When you've got your shortcodes defined like this: [myform] Foo: [mytextbox name="foo"] [/myform] And in your php: function shortcode_myform($atts, $content = null) { return '<form ...
1
vote
1answer
915 views

do_shortcode inside AJAX callback

I have an AJAX callback function inside my functions.php file, which displays posts in a specific category. add_action( 'wp_ajax_ajaxified_function', 'ajaxified_function' ); add_action( ...
4
votes
2answers
1k views

Split Content and Gallery

Is there a way to split up the post content and the gallery short code. I want to display the gallery outside my normal content no matter how or where it is placed. I can use this to get the shortcode ...
0
votes
1answer
199 views

Wordpress core responsive video not working with shortcode

I cannot get the video from Wordpress core to behave responsively. I'm using the following CSS: .videocontent { width: 100%; height: 100%; max-width: 1024px; margin: 0 auto; } ...
0
votes
1answer
83 views

Passing values between enclosing and enclosed shortcodes

Is there a way to pass data between the enclosing and enclosed shortcodes? For example, I would like to do something like: [boxes per_row=4] [box]foo[/box] [box]bar[/box] [box]baz[/box] ...
1
vote
0answers
132 views

WP UI style within shortcode - Any Suggestions?

I am using the wp-ui Wordpress plugin to create vertical tabbed content. What I want to do is add a span to part of the tab title - to add some additional style, but the shortcode/plugin strips my ...
0
votes
0answers
80 views

Popup form in pricing table created with shortcodes and contact-form-7

I have a pricing table on the website which is created with short-codes and css ~ [pricing column=4 title="Starter" price="$500" per="one time fee" button_url="/#/" button_text="REQUEST A PROPOSAL"] ...
0
votes
1answer
60 views

Is it right way to create shortcode?

I want to create a shortcode, but it creates empty <p> tags in the output. I'm using the following code to avoid that problem, however I'm not sure if this is correct way. I have read that if ...
0
votes
0answers
73 views

How to detect shortcode usage, submit a form from widget to that page?

I've created a plugin and now want to create a widget containing a form that will submit to the page where my plugin shortcode is embedded from any wordpress page on the front end. I assume that ...
1
vote
0answers
159 views

How to protect parts of my code from TinyMCE modification when switching from text to visual mode?

I've got the following problem. When I switch from 'text' to 'visual' mode - TinyMCE is automatically messing around in the code doing unwanted things which breaks my styling - not so good ;/. Is ...
0
votes
1answer
133 views

WordPress Not rendering short code properly?

So I have other short codes that are built in this fashion and I cant figure out what i did between them and this one, This short code is used as such: [code code="function(){}"] to wrap your input in ...
0
votes
1answer
554 views

ob_get_clean returns empty string, ob_get_flush outputs string

I am utilizing a template-type system, to filter the_content. My filter contains this partial code: ob_start(); include_once ( self::$dir . 'views/templates/' . $post_type . '/' . $display . '.php' ...
0
votes
1answer
1k views

Woocommerce, ordering products by default on shortcode pages

In my woocommerce store I have a Sale Products page. In this page I use the shortcode to display the products on sale [sale_products per_page="40" columns="3"] In the store the products are ordered ...
1
vote
1answer
109 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 ...
0
votes
1answer
308 views

Shortcode does not display pagination [duplicate]

I use a normal page for display posts by a shortcode.On pages posts are displayed correctly,but doesn't echo the next and previous posts links and the page content is displayed below shortcode ...
2
votes
1answer
295 views

Get multiple shortcode attribute values

I'm trying to get several values from a shortcode. I tried several things without success. The shortcode looks like this: [myshortcode metakey="<field_key:key1, title:Title ...
1
vote
1answer
131 views

How to change to local video player on shortcode ultimate to video.js?

I have Shortcodes Ultimate plugin, and I would like to change this plugin video player to Video.js player. That's becouse, the original player is very afful, and instabil, and you can't control ...
1
vote
2answers
255 views

Call Shortcode inside another Shortcodes callback

I'm using a plugin that shows content only to specific user roles. This content is surrounded by a shortcode tag to make it invisible to other other user roles. Now I'd like to call other shortcodes ...
0
votes
2answers
65 views

get value from post to sidebar

I have the following div in my post, <div class="my_calss" id="my_id"> my content </div> Here, my_id is different for each post. I need to display my_id in sidebar into php code. ...
0
votes
1answer
141 views

Get post object in shortcode function

I have to display a post from another page (index.php), so my code is $section_id = 16; $section_home = get_post($section_id); setup_postdata( $section_home ); the_content(); This post (with ID ...
1
vote
2answers
194 views

What are the disadvantages of using global variable?

I am a newbie at WordPress. In my "recent posts" shortcode, I used global $post variable, because the_title() function was giving me page's title, not post's title. I am not exactly sure, but I ...
0
votes
1answer
104 views

get data with shortcode

i have a wp db. and i added a table "wp_mapmus" now i want to show these datas on post page with shortcode. But there is an error. and i dont know php very well. i only use same plugins. what is the ...
2
votes
2answers
715 views

Pass boolean value in shortcode

In WordPress shortcodes, how can I pass boolean attributes? Both of [shortcode boolean_attribute="true"] or [shortcode boolean_attribute=true] are giving string values. EDIT There would be no ...
0
votes
1answer
83 views

Running a Gallery Shortcode in a Custom Fields Widget

I am creating a website for a Fringe Adelaide Venue, we have planned on displaying a gallery on each artist page. We are already using Custom Fields to place some unique content in a Custom Fields ...
0
votes
2answers
119 views

Adding an option to a shortcode

I'm trying to write a shortcode that will allow the option to display all users or show a singular user, defined by a user id or "nicename". The shortcode would look something like this: [staff ...
0
votes
1answer
88 views

adding a shortcode into a custom post type

I want to add the upload file plugin shortcode to a custom post type for a client build (if there's a better way to do this, please tell me). Basically I've got this - echo ...
0
votes
1answer
29 views

How to put custom admin setting field into a shortcode

I set up an admin settings menu and I'd like to output the fields as a short code. The way I learned to output the fields from a tutorial was with: <?php $input_examples = ...
0
votes
1answer
154 views

Append jquery script for each [partners] shortcode with specified values

I'm trying to do a shortcode which will add additional jQuery script to wp_footer. So this gonna be an example shortcode: function partners($atts ) { global $extra_options, $pslider; ...