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)

4
votes
2answers
956 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
190 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
77 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
126 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
78 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
68 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
148 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
120 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
463 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
107 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
301 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
240 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
123 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 ...
0
votes
2answers
162 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
64 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
117 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
173 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
94 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
613 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
79 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
118 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
83 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
28 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
143 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; ...
0
votes
0answers
425 views

Get page content and execute shortcodes on a page

I would like to get show multiple page's content on one page with shortcodes. If I use return $html; the shortcodes not working, if I use return do_shortcode($html); the shortcode working, but the ...
1
vote
2answers
67 views

Is it possible to make shortcodes NOT case sensitive?

I was wondering if it is possible to make shortcode not case sensitive, should be pretty straight forward but I want: [test=1] to work while written as [TeST=1], [TEST=1] And if so, how do I ...
0
votes
0answers
69 views

Shortcode add styles to the <head>

I have shortcodes that has option for :hover color. Is there a way to include styles in the head of a page for each shortcode element to change its hover color? There can be any amount of this ...
0
votes
1answer
53 views

Identifying a Page Containing Shortcode at `init`

I am writing a plugin and I am having some difficulty with when to trigger specific functions of the plugin code. /* // Plugin information goes here */ // ***** Area A $GLOBALS['example_class'] = ...
0
votes
1answer
76 views

Use PHP code in shortcode

Sorry I am not a coder and my English is bad, but I want do this: I have shortcodes: [tabs][tab title="Title1"]Content1[/tab] [tab title="Title2"]Content2[/tab][/tabs] How can I use PHP in this like ...
0
votes
1answer
33 views

How to list users by custom field?

I have a custom user field in the standard database, called company. I want to output on to a page the usermeta info only of users whose company matches Widgets Inc ... How do I do that? What I'd ...
0
votes
1answer
40 views

shortcode - I need to throw a message or load a different page

I am displaying a form on the public side using shortcode.The shortcode is included on Post add_new, located at http://localhost/wordpress/add_new/. On successful saving of form data, I need the page ...
0
votes
1answer
44 views

Initialize add_action() for every copy of a specific shortcode

I have here a shortcode which generate a slider. Everything works just fine until i try to add another "partners" slider with different options. I can't specific settings for each slider because the ...
0
votes
0answers
264 views

Progress bar - JS + CSS

I'm trying to implement a progress bar to wordpress. Exactly this one : http://workshop.rs/2012/12/animated-progress-bar-in-4-lines-of-jquery/ php shortcodes function progress_bar( $atts, $content ...
1
vote
1answer
191 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 ...
0
votes
0answers
62 views

get current event using My Calendar Plugin

I need to get the current event. At the moment it outputs all events for the day. Here is my shortcode so far: <?php echo do_shortcode('[my_calendar format="list" above="none" below="none" ...
0
votes
0answers
66 views

Most elegant way to create html for shortcodes?

Shortcodes seems to be very nice way to introduce complex features to the content blocks, but I don't like to generate html inside shortcode function. Instead I would like to create template file for ...
0
votes
1answer
172 views

How do I add text in a shortcode?

I think this might be an easier question but I can't figure it out. How can I add simple text inside a short code? For example: $return_string .= '<a ...
0
votes
1answer
126 views

Displaying shortcode output through Options Framework

I'm hoping someone might be able to help me. I'm using the Options Framework Plugin to customise my site, but I'm having difficulty with using a shortcode in one of the custom fields. I've created ...
1
vote
1answer
205 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
votes
1answer
236 views

Insert Shortcode exactly at the end of the content

<?php echo do_shortcode("[sharethis]"); ?> <?php wp_related_posts()?> There are 2 short codes above 1) share this plugin short code 2) related posts short code now my ...
5
votes
2answers
625 views

Create custom [sourcecode] shortcode, the right way?

What I want to do Sharing code in posts on WordPress is quite a pain with all the HTML escaping to take care of. So, I plan to enclose code in posts within a custom shortcode called [sourcecode], as ...
3
votes
2answers
345 views

using html as shortcode attribute

I have created a shortcode that retrives and displays top recommended posts based on a meta_key. There are different attributes, which all work, except for once where the content of the attribute is ...
0
votes
0answers
124 views

Plugin or shortcode for ISBN number?

I have a Woocommerce site with a catalogue of books. Each book has an ISBN (or EAN) number entered in a custom field. I need to do two things with the ISBN, and I don't want to have to manually ...
0
votes
1answer
135 views

Can I use widgets & shortcode if I need to return an array?

I'm trying to achieve the following functionality. I have several widget 'areas' that I can place widgets into. I programmed these widget areas into the theme of my site and I can turn them on and ...
0
votes
1answer
104 views

Replace shortcode with output in database?

For example, say I created a shortcode called [sourcecode] using the Shortcode API function, which is used to share code in posts like so: [sourcecode] #button { font-weight: bold; border: ...
0
votes
0answers
149 views

Creating tabs shortcode

<div id="tab-side-container"> <ul> <li><a href="#side-tab1">Tab 1</a></li> <li><a href="#side-tab2">The Second Tab</a></li> ...
0
votes
1answer
165 views

do_shortcode within post query

I am querying blog posts with a specific category (according to the template page slug, and want each post to output a slider, title and content. I'm using the wordpress plugin Anythingslider for ...
0
votes
1answer
25 views

Shortcoding with Divs

I am trying to turn a custom query into a shortcode but I am having some difficulty. Firstly, I am not sure how to return a custom thumbnail size via $return_string...in fact I am not sure how to ...