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
721 views

How to add class or id to shortcode HTML elements?

I have a row elements and 3 columns inside : [row] [one_third]1[/one_third] [one_third]2[/one_third] [one_third]3[/one_third] [/row] How can I add a custom class or id to [row] element ? I need to ...
0
votes
1answer
17 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
78 views

Shortcode in my childtheme is not working

function get_employee_func(&$totalCount) { global $wpdb,$_POST; $query=''; $sql=''; $query="Select * from wp_users as U left join wp_company_user as CU on U.ID = CU.user_id LEFT ...
0
votes
0answers
78 views

Infinite Scroll plugin works but no [shortcode]

On my blog I use the Infinite-Scroll plugin. Works properly, but in the new post loaded I didn't see shortcodes (ex. [jwplayer ..]), or the galleries created by the editor (appears "This slideshow ...
0
votes
0answers
137 views

Working with “Event Manager” Plugin and “lightbox plus colorbox” plugin for featured image

currently working with "event manager" & "lightbox plus colorbox plugin" for featured image, I have loaded image using featured image but on output side when clicking on that featured image ...
1
vote
3answers
123 views

Checking if an attribute exists in a shortcode

I've written a small plugin that spits out html for a button. It works great, except for one thing: If the user doesn't specify an image, the image appears broken. Is there a way for me to check and ...
0
votes
1answer
27 views

How to use shortcode of any plugin to show it visually where i want?

I don't know much about shortcode. I have a countdown plugin with this plugin i'm displaying 'countdown timer', i can post it with shortcode E.g [countdown event="Event with hour & minutes" ...
0
votes
1answer
111 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
31 views

Defining the output of a Wordpress Att

I have this code where I'm trying to define how those attributes (ptid, ptle, pge ) will behave once the code runs. I would like to be able define them so to get them to execute functions before ...
0
votes
1answer
51 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
41 views

Featured image with link to post shortcode, image displaying above the post

I have created a shortcode to display the featured image linking to the post: function ck13_post_image($atts){ extract(shortcode_atts(array( 'ck_img_size' => 'full' ), $atts)); ...
0
votes
1answer
54 views

Shortcode / WP_Query in post changes context

We have a shortcode that causes WP_Query to be executed, retrieving an instance of a custom post type. In our single.php this changes the context (after the call to the_content()) from the original ...
0
votes
2answers
247 views

Custom Shortcode and Button not Working after 3.9 update

I have added a new button that creates a short code but it seems that after the newest WordPress update, the button is not working any more. The button is visible but when someone clicks it, nothing ...
0
votes
1answer
32 views

Is it possible to include the add_filter() function within a shortcode function

I am trying to pass content to the 'google_dfp_ad_slot' filter. Can this be done within a shortcode funcion? /** * Shortcode function to dynamically add google dfp ads to inline content and ...
0
votes
1answer
43 views

How to display class name in this shortcode post query

I need help with this as it's my first project of my new job & I'm stuck at this point. I'm retrieving custom post types portfolio using this code as a shortlist: extract( shortcode_atts( array( ...
0
votes
1answer
35 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 ...
1
vote
1answer
72 views

Making Quote Plugin more efficient

I've been working on this plugin the past couple of nights and have been jotting down idea's of how to improve it. My knowledge of php isn't the strongest and I'm learning as I go along most of the ...
0
votes
1answer
88 views

Adding body class when post contains a specific shortcode

Simple shortcode function : function my_shortcode_function($atts,$content=null){ // Do something return $content; } add_shortcode('my_shortcode','my_shortcode_function'); I wonder how to add ...
0
votes
0answers
16 views

HTML output on shortcode [duplicate]

I am using Olevmedia Shortcode plugin and I created my custom shortcode. When I included the custom shortcode inside a column shortcode of the plugin, the content of the shortcode is on the outside of ...
0
votes
1answer
212 views

How to extract the variables out from “add_shortcode” function?

In Wordpress, lets say i have a custom Shortcode function, like: function foobar_func( $atts ){ //whatever required processings here... $foo = "the value is foo!"; $bar = "the value is ...
0
votes
1answer
136 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 ...
1
vote
2answers
120 views

(solved) how to have the gallery shortcode output one single UL list instead of several DL?

I need the built-in gallery shortcode to output UL instead of DL. How can I do it? I know I can use the 'post_gallery' filter, but that means almost duplicating the media's gallery_shortcode function. ...
0
votes
0answers
56 views

Members only Passthrough

So I made a members only site with wordpress by redirecting everything to the homepage and adding a registration/login page to my homepage. This was added as a plugin: /* Change Login URL */ ...
1
vote
0answers
14 views

Getting the number of nested shortcodes [duplicate]

[slider] [img] [img] . . [img] [/slider] Is there a way that I can get the number of nested shortcode in a parent shortcode Thanks
0
votes
0answers
105 views

Create shortcode in Child Theme?

I have created a child theme, and I am trying to add a shortcode to its functions.php file, by doing this: // functions.php of child theme <?php include(WP_CONTENT_DIR . ...
-1
votes
1answer
38 views

Overwrite functions.php of a theme - What if the theme is updated?

I have added a shortcode inside a functions.php file of my a Theme. I am wondering that if the theme changes, it might overwrite the current functions.php file. So, is this true? If so, where should ...
1
vote
1answer
82 views

Custom shortcode being executed when saving page in wp-admin

I'm working on a custom shortcode: [abuzz-store slug="woolworths" fields="description,level,phone" more="true"] The shortcode is working correctly on the website frontend. However, I can no longer ...
0
votes
0answers
61 views

apply_filters to content but ignore shortcodes

I want to prepare my content added via wp editor so it displays nicely, so I use apply_filters like so: $ld = apply_filters('the_content', $ld); That works fine for the page, but in the backend ...
-1
votes
1answer
60 views

How to read a page's “Shortcodes” from the Template File?

Lets say i have a Page, and it contains some shortcodes like: [myshortcode foo="bar" bar="bing"] [anothershortcode foo="bing" bing="bar"] Then how do i read those from my custom Template File, to ...
1
vote
2answers
77 views

Change Wordpress Shortcode added in to post

Problem: I am using a plugin that turns the wordpress gallery into a cool slide show. How ever, every time I make a gallery - Wordpress add this code to the post . [gallery ids="334,332"] I need ...
1
vote
1answer
31 views

'&' causes an error in my shortcode when I list the content of the page

I would like to list the specified pages with my shortcode, but the problems are with the '$' charachters. function get_page_func( $atts ) { extract(shortcode_atts( array( ...
1
vote
1answer
98 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
2answers
254 views

Generate Shortcodes by Taxonomy

Check this code: function slide_group() { register_taxonomy('Group', 'slides', array( 'hierarchical' => true /*visualizza come le categorie*/, 'label' => ...
0
votes
1answer
236 views

How to copy [gallery] shortcode between posts using polylang [closed]

We're using the excellent polylang to translate our website content and themes , there are a range of options about which fields and settings are duplicated between paired pages. We've selected to ...
0
votes
2answers
80 views

How to display data from custom fields in my custom shortcode?

This is the shortcode I have come up with, according to a tutorial on Dig WP (http://digwp.com/2010/01/custom-query-shortcode/) in order to display list of songs on specific albums. [loop ...
1
vote
0answers
78 views

Curly bracket shortcode in header.php [closed]

I am using a plugin which uses a short-code format with curly brackets { I want to display this short-code in the header.php. Usually the following code works: <?php echo ...
0
votes
2answers
151 views

Return vs Echo Shortcode

Ok, so I've created a short code which echo's some of the output; the problem I discovered is that the values must be returned instead of echo'd. I'm having problems converting the shortcode to return ...
0
votes
1answer
57 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
40 views

Basic do shortcodes question

I used WordPress codex page to code. As you can see I have 2 PHP codes in my line. The page is able to get the code's value but it doesn't obey the CSS rules, which I believe, because I inserted my ...
0
votes
1answer
331 views

How to call Shortcode categories for custom post types?

Hi I'm trying to do something rather tricky in my Wordpress Theme I'm more of a designer front-end developer so its a bit of a guess work with php. Anyone have any ideas why this code only displays ...
0
votes
1answer
71 views

shortcodes - style them or change/remove the square brackets?

I sometimes use for the clients, plugins that are based on wordpress shortcodes,they do offer a lot of options for the clients to play with like adding tabs galleries and so on. But I see that the ...
0
votes
0answers
75 views

Custom Loop Using Shortcode in Custom Page Template

I am trying to output a custom loop created using shortcode in a custom page template. Here is the code I am using to generate the shortcode: function archive_sc( $atts ) { // Attributes ...
0
votes
0answers
30 views

Custom Shortcode that includes filtering by tag

Within a custom shortcode, how do I filter the posts that come back from get_posts() such that only posts with Tag = "xyz" are returned? Here is what I have in my shortcode currently: $args = array( ...
0
votes
0answers
455 views

Shortcode issues in wp job manager plugin

I need to display job listings as per job types using shortcode in posts/pages. For that i have installed http://wordpress.org/plugins/wp-job-manager/ plugin. The issue is, when i place two shortcode ...
0
votes
1answer
138 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
176 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 ), ...
1
vote
2answers
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
91 views

Echo HTML in custom shortcode

I wrote a shortcode that I am trying to refine. It basically just gets a list of bookmarks and prints them. But I need to to add HTML around it depending on the type that is defined. ...
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 ...
1
vote
1answer
46 views

How can I whitelist only specific shortcodes for processing in text widgets?

I know that I can use the following filters to enable processing of shortcodes in Text Widgets: add_filter( 'widget_text', 'shortcode_unautop'); add_filter( 'widget_text', 'do_shortcode'); How can ...