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
1answer
55 views

Placing raw HTML inside a WordPress shortcode

My shortcode: function fullwidthFunc($atts, $content = null) { $atts = shortcode_atts(array( "backcolor" => 'transparent', "backimgurl" => '', "color" => 'black', ...
0
votes
1answer
142 views

How to parse shortcodes within returned content

I'm using Visual Composer, but I think it has more to do with WordPress than VC ;-) I did a shortcode (with the VC API) to get the content of a post. Here it is (in functions.php): add_filter( ...
0
votes
1answer
22 views

Pass instance number to shortcode child

I have problem passing my instance variable of shortcode [answers] down to it's childrens [ans]. Couldn't use global since that loses it's value. Here is the code: function ...
0
votes
0answers
22 views

tinymce wpview instance URL

I want some special URL types to be transformed in embedded content objects in the tiny MCE editor. I registered some them like that add_action('init', function() { ... ...
0
votes
1answer
49 views

embedding shortcodes in php template

I am using a plugin that has shortcodes. It is called according shortcodes [accordion] [accordion-item title="Title of accordion item"]Drop-down content goes here.[/accordion-item] [accordion-item ...
0
votes
1answer
51 views

Modify page title and subtitle with a plugin

How can I build a plugin which will modify a title (header) of the page? I built one generic page which uses shortcodes to display relevant information based on url parameters, but I can't use ...
1
vote
1answer
66 views

Wordpress shortcodes are not working

I am trying to use shortcode in wordpress. but its not working. I am new at this kind of job. My codes are: This is a post with short code ...... [contact-form] [contact-field label="Name" ...
0
votes
1answer
32 views

Add a short code to a plugin

I'm looking to extend a few plugins by adding custom shortcodes. These plugins create front-end pages, but I want to display that page content on another page. I figure there's an easy way to just ...
0
votes
1answer
45 views

Debugging shortcode problems

I am trying to get some of the Miscellaneous shortcodes working properly on my website. In particular, I would like to use the pages shortcodes: [list-pages], [child-pages], [sibling-pages]. I am ...
0
votes
1answer
105 views

Display WP-Types custom fields in post [closed]

I have a WooCommerce website where on products I added some custom fields using WP-Types plugin. The website has a section "News", which basically is a blog. How can I insert wanted products into a ...
1
vote
1answer
38 views

Can a shortcode return its own name?

Assuming there is some function or variable that allows the shortcode access to its name, and for sake here I will term that $scName, is something like this possible: function ...
0
votes
0answers
61 views

Get current post id witout passing in shortcode

Is that possible to get current post ID without passing in shortcode as parameter. Like [related-post] I want to get the post ID in which post this shortcode will use. add_shortcode( ...
2
votes
1answer
231 views

Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]

What I eventually want to do is when user logged-in to the site, I want to redirect the to the page with all the post created by that user and I want to load them via AJAX request. I have save ...
0
votes
1answer
18 views

Theme Icons not visible on http://domain.com, works on http://ipaddress

I have a wordpress based website released. I have used a theme, that allows icons to be used. These icons are not small images, but shortcodes that I use on the page. Open http://<my ip ...
0
votes
2answers
103 views

Excerpts are not displayed by a shortcode on category pages

A 3rd party plugin that I use adds a shortcode that displays a list of adverts (CPT posts). The shortcode function includes (with an include statement) a template - the list.php file, that displays a ...
0
votes
1answer
51 views

Find all strings between an enclosing shortcode

I want to look for all strings in my theme located between my enclosing shortcode [question] desired string [/question]. Then I want to output the so collected strings somewhere in my theme , e.g. ...
0
votes
2answers
56 views

Create a function to display HTML/data based on site admins role?

I need to make a shortcode to display some HTML on a page based on site admins "role"? Not the logged in user but the site admin's role. By default the role is 'administrator' and the only other role ...
2
votes
1answer
58 views

Error when overriding only some audio shortcode HTML output

Context I have a function that overrides audio shortcode HTML rendering, thanks to a WordPress hook: wp_audio_shortcode_override I used it this way in an OOP plugin: add_filter( ...
0
votes
2answers
59 views

Pass Shortcode Attribute to footer Script

i am trying to generate a wordpress shortcode which will display a (bx)slider. The shortcode function itself works like a charm, i can pass my data and the shortcode gets rendered well. The problem: ...
0
votes
2answers
167 views

Passing attributes to shortcode dynamically

Can I pass dynamically to shortcode attributes like as the following example shows [ authoorsposts author = get_the_author_id(); ]
0
votes
0answers
81 views

Function inside shortcode doesn't display WP_Query properly - custom post type

I have a problem with some shortcode and a function to display list of shops based on another shortcode. I wrote some code: Shortcode function shops_list($atts){ extract(shortcode_atts(array( ...
0
votes
0answers
67 views

Insert image caption (metadata) in shortcode in functions.php

I've created a shortcode that displays a random image given that certain parameters are filled, like img url and number of images to random through. It looks like this: function randimg_shortcode( ...
2
votes
1answer
148 views

What is rich_editing?

I wanted to learn more about shortcodes with button implementation since I do not use them much and I have been doing a lot of research on the topic and the questions and tutorials I run across use a ...
0
votes
2answers
27 views

Will a shortcode placed inside a paragraph tag still be valid?

I looked at some code for an article and saw that there was a shortcode contained in a <p> tag: <p>Blabla</p> <p>[shortcode]</p> <p>Wofwof</p> The ...
0
votes
1answer
37 views

Retrieving Advanced Custom Field within Shortcode Function [closed]

I'm trying to do something that seems like it should be (and probably is) simple: display the result of Advanced Custom Fields get_field() call within the return of a shortcode function. Within a ...
1
vote
1answer
106 views

Why is my shortcode not working

Im making a custom shortcode for my wordpress site and im just running through the example from the shortcode api for wordpress: function myshortcode() { $atts = shortcode_atts( array( ...
0
votes
1answer
105 views

AJAX and do_shortcode

I know questions on this subject have been asked before. But I'm stuck and cannot find a way out. I am using Ajax to load external information to my site. Initially all the information was loaded at ...
0
votes
0answers
36 views

Call attributes from shortcode function to a JavaScript function?

How do I call attributes from shortcode function to a JavaScript function? extract(shortcode_atts( array( 'xyz' => '' ), $atts )); I want to call xyz's value in ...
0
votes
2answers
76 views

How do I turn a shortcode into php?

I need to add a shortcode into one of the php files (replacing a search bar code that is hardcoded into the header php file). How do I add a shortcode to the header php file? This is the code that I ...
0
votes
1answer
26 views

Shortcode not working in widget

I created the following shortcode: function newsletter_signup_shortcode( $atts ) { $post_type = get_post_type(); // Attributes extract( shortcode_atts( array( 'location' => ...
0
votes
2answers
21 views

php in a shortcode

One of the major problems I have with a big site is the number of templates. So I figure I could call an optional footer within the page using a shortcode. function trainer_footer( ){ ...
0
votes
2answers
87 views

Formatting Shortcode to Display in Visual Mode

I was wondering if it's possible to convert this kind of shortcode: [card name="Muscle Band" set="XY" no="121" c="name"][/card] Into this in Visual Mode (in blue-colored text): Muscle Band XY ...
-1
votes
2answers
132 views

Previous/Next with the same category

I have this code to use with shortcode at my portfolio pages. Everything is working fine, but I need that next and previous get the same category. This is the code: add_shortcode( 'prev', ...
0
votes
1answer
97 views

PHP Shortcode - 500 error

I have been working on a shortcode with help from this article: http://code.tutsplus.com/tutorials/create-a-shortcode-to-list-posts-with-multiple-parameters--wp-32199. I have tried to do what the ...
0
votes
1answer
54 views

Use html tags in shortcode_atts, is it real?

can i use html tags in shortcode attributes? like this: function b_text( $atts, $content = null ) { extract( shortcode_atts( array( 'text' => '<div class="myClass">DOM</div>' ...
0
votes
0answers
14 views

Show invoice in PDF based on user selection - wpcf7_posted_data [duplicate]

Here is my code and it's not working. function show_bill( $data ) { $data = do_shortcode( '[pdf-embedder url=http://xyxy.com/home/invoices/TCH6418086-2015Sep28_Oct04.pdf]' ); return $data; } ...
0
votes
1answer
98 views

call other shortcode in the email contactform7 send

Please advise how I can call other shortcode in the email contactform7 send. Here is my code: function show_bill( $wpcf7 ) { $wpcf7 .= do_shortcode('[pdf-embedder ...
0
votes
0answers
16 views

Call other shortcode on button click [duplicate]

How can I run other shortcode on click? Here is my code: add_action( 'wpcf7_before_send_mail', 'show_bill' ); function show_bill( $wpcf7 ) { $form = do_shortcode('[pdf-embedder ...
0
votes
0answers
31 views

How can I call other shortcode in the form?

I am using the following code. It works fine, but the issue is my form gets replaced with the result of the shortcode. How can I call the shortcode without replacing the form? add_filter( ...
0
votes
2answers
52 views

Shortcode arguments to another shortcode

I am learning about shortcodes. I've made 2 shortcodes that makes an accordion with bootstrap. One shortode (accordionGroup) creates the body that contains one or more shortcodes to make the items and ...
0
votes
0answers
41 views

Shortcode Displaying Content Twice

I have written this shortcode in my functions.php, its taken from a plugin but its functioning as stand alone, because i have renamed functions and shortcode. This shortcode prints the content of wiki ...
0
votes
0answers
23 views

Portfolio does not appear in Mutilingual site - PolyLang

My theme has an inbuilt portfolio, as it's a portfolio specific site. I'm localizing the site, and have been using the Polylang plugin for subdirectory creation. I have added the shortcode (that the ...
0
votes
0answers
20 views

Attempting to add an imagemap/ content to Front Page — shows up only in meta description

I'm dealing with a nasty old theme for a friend that uses a huge slider as its homepage background image. I'd rather not scrap and recreate the site, as back in the day I put in a good amount of ...
1
vote
2answers
27 views

Freeze a shortcode in place?

Is there a way to "freeze" a shortcode in place so non-Administrators can't edit it? Let's say I have a page like this: [shortcode] Text of the page [other shortcode] Is there a way that ...
0
votes
0answers
51 views

How to call metabox value in custom post type query shortcode?

I am trying to make a testimonial shortcode. That is why I registered a custom post type and now trying to call it using shortcode. I also create a custom metabox for testimonial client country input. ...
0
votes
1answer
193 views

How to create a shortcode for custom page template

I have a custom page template and I want it to display on specific pages. The only way I know to do this is to create a shortcode for this custom page template, so that I can use the custom page ...
0
votes
1answer
43 views

Metabox Keeps Stripping Parts of Shortcode

I am creating a custom metabox, and it will be filled with shortcode. The problem is, after I saved it, it keeps stripping / deleting the last part of the shortcode, like this: Suppose to be: ...
1
vote
3answers
66 views

Remove Shortcode […] from Blog Preview

When utilizing shortcode (plugin, etc.) near the top of the page, the plugin shortcode displays in the preview. Is there a way to hide text within brackets [text like this] from a preview on a recent ...
1
vote
3answers
77 views

Shortcode output is screwed up when arrow symbol “<” is present in content

I have a very simple shortcode to print some text using pre tags function term_shortcode( $atts, $content = null ) { return "<pre>" . htmlentities($content) . "</pre>"; } ...
0
votes
0answers
71 views

Inserting PHP code snippet via shortcode

I'm trying to insert a PHP snippet on a WordPress page using XYZ Insert PHP Code Snippet plugin. This is the code that I'm using but it's not working and I can't figure out what's wrong. I've tried ...