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
33 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
110 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
80 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
168 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
51 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
50 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
46 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
100 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
152 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
126 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
43 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
52 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
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 ...
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
37 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
100 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
85 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
473 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( ...
1
vote
2answers
306 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
137 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
57 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
107 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
56 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
48 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
116 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
83 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
257 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
526 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
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 ...
0
votes
1answer
255 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
139 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
90 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
88 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
58 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
71 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
105 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
67 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
383 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
71 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
110 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
59 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
25 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
105 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
244 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
57 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
51 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
47 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'] = ...
1
vote
1answer
70 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
27 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 ...