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)

1
vote
2answers
75 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
70 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
54 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
77 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
42 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
45 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
269 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
205 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
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
195 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
144 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 ...
2
votes
1answer
237 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
267 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
648 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
448 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
138 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
139 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
114 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
174 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
174 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
27 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 ...
0
votes
1answer
73 views

Custom WP theme not showing shortcodes

I'm building a custom theme and am trying to use the Nivo Slider wordpress plug in. I have a widget area under my nav bar and for some reason only the shortcode shows, not the slider. I have read that ...
5
votes
1answer
116 views

Autoembeds don't work with paragraphs

I'm writing the below pieces of code in "Text" mode of the posts editor. Does work: http://www.youtube.com/watch?v=xxxxxxxxxxx Does work: <p>test http://www.youtube.com/watch?v=xxxxxxxxxxx ...
2
votes
1answer
64 views

Stop parsing shortcodes

I'd like to stop parsing shortcodes in the_content but I'm struggling to find what the correct filter would be. This didn't work: remove_filter( 'the_content', 'do_shortcode', 40 ); remove_filter( ...
0
votes
1answer
294 views

Last post ordered by publish date using WP_Query on front page

I'm joining together few websites into one and I created appropriate posts and changed their post_date (publish date) to the original time of post. However (even if I list more than 1 post) the ...
0
votes
1answer
30 views

Is it possible to handle two or more shortcodes in a single page?

I have a shortcode [API-Module version="1"] and another shortcode like [API-Module version="2"] If i handle any one at a time in a single page it works perfectly. Yet my requirement needs both had to ...
0
votes
1answer
358 views

SImple Example To Update User Info From Front End [duplicate]

I want to give user ability to update their nickname from front end using wp_update_user and shortcode. The code below is working. add_shortcode('user-profile', 'get_current_user_prof'); ...
0
votes
0answers
155 views

Get ID of the page where shortcode is included

I have a page with a shortcode that uses get_the_ID(). The shortcode displays custom fields from the current page. When I include that page within another page, get_the_ID() returns the ID of the ...
1
vote
2answers
324 views

Localize variable for multiple Shortcodes

I have this code for flexslider Shortcode add_shortcode('flexslider', function($atts){ global $post; $ids = explode(',', $atts[ids]); $uniqid = uniqid(); wp_enqueue_script( 'shortcode_flexslider'); ...
1
vote
1answer
281 views

Form Shortcode not saving data to WP database

I'm developing a plugin that creates a custom table upon plugin activation. The plugin allows users to add a form shortcode to collect data for leads. I've got to the point where either the data ...
0
votes
1answer
138 views

Trying to override/intercept a PhotoMosaic gallery link in Wordpress using jQuery

The page in question is located at http://www.sandbarmedia.com/clients/va/gallery/. Basically, I'm trying to use jQuery to intercept a click on one of the photos in the mosaic so that it jumps to the ...
0
votes
0answers
53 views

Use shortcode as parameter for another shortcode

I'd like to use a shortcode as a parameter to pass to another shortcode: [google_map address="[content field='address']"] However, this outputs a blank map plus this string: "] I've looked in both ...
0
votes
0answers
55 views

Display certain category in a page

Is there any way to display certain category name in a page via shortcode? Edit: I have plugin which displays posts in pages by shortcode [display-post id=id of post]. I would like to have similar ...
0
votes
3answers
85 views

Shortcode question… javascript

We want to create a short-code. The final output of the source code should be similar to the code mentioned below. <script type="text/javascript" ...
0
votes
0answers
55 views

How can I determine if functionality is provided by a plugin or a custom shortcode on another wordpress site?

Recently, I purchased a theme from AIT-Themes.com, a company dedicated to Wordpress theme development. I purchased the Directory theme, and here is a page from that theme I'd like to be considered: ...
0
votes
2answers
93 views

Print shortcode in custom action hook not where the shortcode is entered

I have added a custom action hook into my theme. I want to be able to enter a shortcode anywhere in the_content() and have the shortcode print were the custom action hook is rather then the point from ...
0
votes
2answers
158 views

Shortcode to find and replace URL

I'm trying to create a shortcode that will search within some specified text for a link and replace it with one that I specify. For example: [scode]Click on <a href="www.X.com">this ...
1
vote
1answer
213 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 ...
0
votes
0answers
48 views

using enqueue_script in a shortcode isn't working

I'm new to wordpress and I'm trying to get this to work by following the wordpress codex but I feel like I must be missing something obvious. I have a child theme based off of a parent one, and I ...
0
votes
1answer
124 views

How to stop unwanted splits in excerpts when using shortcodes for sliders or players

Am using this code in functions.php: Issue with enabling formatting in excerpts in Wordpress to allow shortcodes, javascript and formatting in the excerpt - works great, thanks. However, I am also ...
0
votes
0answers
58 views

Code auto escaping is not working when using short codes

I'm using this ages old, but still well working, plugin (source code here) to auto escape html inside <code>. All is well and good until I tried to use short codes to form the ...
1
vote
1answer
709 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
81 views

How to generate CSS from a shortcode within a plugin

I'm struggling to generate CSS 'on fly' from a shortcode that is within a plugin using class. Here is the shortcode function: public function shortcode($atts, $content = NULL) { $data = ...
1
vote
2answers
247 views

Nested Shortcode Inside [caption] Doesn't Process

Captions in wordpress do not support nested shortcodes at the moment (v3.6). So, If I do write [caption]<img src=""> I love my [city][/caption] Where city is suppose to be processed but it ...
0
votes
1answer
58 views

Toggle Shortcode Sanitize Title

Wondering if anyone can help me out... here is my custom theme shortcode: add_shortcode('toggle', 'shortcode_toggle'); function shortcode_toggle( $atts, $content = null ) { ...
0
votes
2answers
151 views

How to link to a alternative page in CSS

I have a wordpress site and I want to be able to completely change a page that is displayed based on the browser size in my Custom CSS, so that if it is over 1500 pixels it loads a completely ...
1
vote
1answer
849 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 ...
2
votes
2answers
158 views

Problem with email_exists in shortcode

I have a custom registration form that I insert into a page via shortcode. The shortcode function looks like this: function custom_registration_form_shortcode() { $error = FALSE; if ...
0
votes
0answers
25 views

Shortcode for sectors

We've been given a WordPress site that has the following shortcode in the body of the page. [show_case_studies post_type="case-study" posts_per_page="15" order="ASC" orderby="menu_order" ...