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

Executing Javascript in Plugin

I am trying to display a google map using short code for a plugin I am building, but I can not get it to work. Does anyone have some advice on this? Here is my code: add_shortcode( 'show_map', ...
0
votes
1answer
30 views

Access Shortcode in ajax code?

I have some data which is pulled over using ajax. Data works all fine, however, I have some shortcode been used in the same data which doesn't display as expected. It looks like shortcode function ...
0
votes
1answer
32 views

Wordpress Short code with additional parameter

I am using twitter boostrap in my recent project . I want that the post or page content will split into columns. For doing this I am declaring several shortcode like this function ...
0
votes
1answer
83 views

Preserve shortcode content formatting

How can I preserve the formatting of the content within a shortcode block when I switch back and forth between the visual and text editor in TinyMCE? As in, the stuff between [myshortcode] and ...
0
votes
1answer
186 views

Passing postid of Testimonial Custom Post in Shortcode Parameter

I am trying to create Testimonial custom post and display using shortcode function create_post_type() { register_post_type( 'testimonials',//new post type array( ...
0
votes
1answer
78 views

Shortcode Display From Wordpress Dashboard Page Without Using post_id

I have this code for showing recent posts on my home page custom theme and it works well. functions.php code: function my_recent_posts_shortcode($atts){ $q = new WP_Query( array( ...
0
votes
1answer
127 views

Adding shortcode to the main menu

Is it possible to add shortcode to a main menu? I tried the following but no luck? add_filter('wp_nav_menu_items','add_nwadcart_widget_to_menu', 10, 2); function add_nwadcart_widget_to_menu( ...
0
votes
1answer
58 views

How to Modify WordPress Default Image Gallery Shortcode

I would like to be able to show 5 columns and only 10 images per page for the default WordPress image gallery. Visually I would imagine it to look something like the following: columns="5" ...
0
votes
1answer
48 views

On selecting shortcode generate selected shortcode table inside page editor worrdpress

i want to create a different different shortcode while choose particular shortcode relative table is show on page editor for example when user choose [some_random_code_sc] that shortcode then relative ...
0
votes
1answer
94 views

Replace shortcode in substring

I've created these two functions to toggle between the first paragraph of the content and then everything but the first paragraph so when the user selects 'More' it slides out the article smoothly ...
0
votes
1answer
33 views

Redirect loop upon installation of my plugin

I have created a plugin that uses a shortcode [MyCreditStatus] to display a form (multi-page form). This plugin uses an API that I also made. When I try to install the plugin, there are times that ...
0
votes
1answer
75 views

Allow user to input shortcode into wordpress widget

This is my first widget, so I'm new to this, but I want the ability to add 6 different shortcodes to the widget that the user can set. The question is this, how do I get the plugin to allow the user ...
0
votes
1answer
35 views

the_time function inside HTML dom parser

I have recently bought a theme, where I want to modify some things. The theme makes use of shortcodes. One of these shortcodes is adding the most recent posts. In these most recent posts is the date ...
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
129 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
57 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
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 ...
0
votes
1answer
173 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 ...
0
votes
1answer
63 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
220 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
191 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 ), ...
0
votes
1answer
23 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 ...
0
votes
1answer
108 views

Shortcode inside <a><span> WP wraps in in a <p> and shortcode is done after

I want to do this: <a href="/wp-login"><span style="pointer-events:none">[shortcode]</span></a> The Shortcode should be disabled but linked to a loginform. but wordpress ...
0
votes
1answer
47 views

How can I create a custom shortcode that will return a custom post type by ID?

Please excuse my ignorance, this seems simple but I can't figure it out and I've been rushing to hack things together. I can't find anything online to help me out. What I have: A custom post type ...
0
votes
1answer
47 views

Shortcode displays only default attribute values

For some reasons every shortcode, that I try to add to functions.php, displays only default attribute value and ignores what I specify in a post. E.g.: function my_shortcode( $atts ) { extract( ...
0
votes
1answer
118 views

Modify function Shortcode_atts

function get_date_posts($params, $content){ $default_params = array( 'post_type' => 'post', 'order' => 'asc', 'orderby' => ...
0
votes
1answer
53 views

How to remove shortcode(s) from WYSIWYG Page editor for Non Admins

Title says it all. We have a front end form on our site where users submit content via front end (also they are logged in while doing this) Because these short codes add them self to the content box ...
0
votes
1answer
62 views

Overwriting a Shortcode

I have a theme that extends the Visual Composer plugin with a slider on the front page. The slider will show five testimonials from five different customers. I want to add the featured image of each ...
0
votes
1answer
259 views

How to create a custom shortcode for custom login form?

I am trying to create a shortcode for the login form to use on a page. I have manage to get a simple form, but am looking to add the "forgot password link" Here is what I have so far ... any way to ...
0
votes
1answer
123 views

Add an access code form to call a unique page based on page without registration

I've seen some similar questions, but they are not totally the same. If I missed in my search, please forgive me. However this what I have so far: I've created a form that has an input field for the ...
0
votes
1answer
162 views

Passing variable in nested shortcodes

How can I pass style attribute of [boxes] shortcode to [box] shortcodes without using global variables? I don't want to use global variables, because I saw on a few articles that using global ...
0
votes
1answer
211 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 ...
0
votes
1answer
53 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
1answer
218 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
249 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
64 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
1answer
148 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
61 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
88 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
34 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
47 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
1answer
199 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
30 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
78 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 ...
0
votes
1answer
154 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
1answer
135 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
1answer
75 views

How to add a nested shortcode into editor?

I want to create an accordion shortcode for wordpress and the html code should be like this: <ul class="acordian"> <li> <h2>sadegh</h2> <p>To delete a comment, just ...
0
votes
1answer
397 views

WP_Editor Shortcode Issue

I have created a front-end editor using wp_editor that functions as it should. Upon testing I have noticed that it is stripping out any shortcodes that have been inserted in the content. I have ...
0
votes
1answer
78 views

Creating a shortcode in a plugin that includes JS

I use a lot of embedded tweets on my site. The script always gets stripped out. I added Twitter's code to my theme, but it doesn't work with infinite scroll. So I'd like to make a shortcode that will ...
0
votes
1answer
79 views

How to show custom taxonomy child posts through shortcode in WordPress

My question: I have custom taxonomy in WP named Videos and childs of this taxonomy named music-videos and game-videos. In my WP theme this is shortcode which shows ALL video posts from main taxonomy ...