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

When using shortcode, content stops generating after the_content

Yesterday I implemented a shortcode, but now my comments and related posts stop appearing. The source of a rendered page now only displays <div class="posts-group"> ...
1
vote
1answer
54 views

Some code in shortcode function being ignored

I have the following code that's part of the shortcodes for a plugin, and I've been trying to debug why it seems to skip a call to do_shortcode. To debug I've been trying to have it write to a log ...
0
votes
1answer
178 views

plugin shortcode not working on ajax request call

I just bought the Visual Composer plugin from wpbakery, my problem is that I'm making ajax calls to get the content of posts that have been edited with Visual Composer when I get the data it only show ...
3
votes
1answer
95 views

Featured image shortcode

Each post currently requires the featured image to be duplicated within the post several times. Is there any way in which I could dynamically call the featured image back into the post rather than ...
0
votes
1answer
128 views

Combining shortcode and get_template_part

I manage a wordpress site and have created a template part that I usually paste below the content. <div class="posts-group"> <h2>Featured store products</h2> ...
0
votes
0answers
13 views

Shortcode Attribute contains clone of all shortcode attributes

This is easily the strangest thing I have see wordpress perform. I have a shortcode, we'll call it my_foo . We'll say it has several attributes, bar_one, bar_two, bar_three . This shortcode is part ...
0
votes
1answer
32 views

Plugin Shortcode value in post

Theme was output with function get_post_meta(get_the_ID(), 'some_value', true); when I try with die(print_r()); function there have some array containing values such as [item_ticket_tailor] => ...
1
vote
2answers
69 views

PHP code inside shortcodes

Basically, I have this line of code: <?php echo do_shortcode('[O_U user_name="operator" blocked_message="This page is restricted for guests."] **Content Goes here** [/O_U]'); ?> Now, inside ...
0
votes
1answer
61 views

How to execute a shortcode outside the post content/entry in a theme?

Please help me execute a shortcode outside the POST CONTENT in a theme. I have created a plugin as following: <?php add_shortcode('jplayer', 'embed_player'); if (!is_admin()) { ...
0
votes
1answer
51 views

Custom shortcode is not working inside tabs

Not able run the shortcode. Created to show custom post type pages inside Tabs created by a plugin. I have attached the image for the same with this post. Here is code I have created. <?php ...
1
vote
0answers
98 views

Problem with multiple shortcode in page template

We have a page (wmnf-events.php) with no content that uses a template file (page-wmnf-events.php). The template has 4 different div containers where each container has the same shortcode but for a ...
0
votes
1answer
39 views

shortcode function outputs multiple anchor tags

I have a shortcode function which displays the latest news, the code for a news item is as follows: $html .= '<div class="latest-news">'; $html .= '<a href="' . get_permalink($recent["ID"]) ...
0
votes
1answer
36 views

Displayed content disappears when adding attributes to shortcode

In my plugin, I´ve added shortcodes that display data from the database and adds some buttons. When buttons are pushed, more data is displayed at the end of the page. This works perfectly when no ...
0
votes
1answer
26 views

How to Manually Code Shortcode?

I'm looking to insert a function which is otherwise denoted as a WP shortcode. The page is failing to display entirely when this code is inserted. Here is the full code which comprises the shortcode: ...
0
votes
0answers
47 views

Include [shortcode] in Angular partial

How can I include a shortcode in an Angular html partial? I have created a theme as an application by using the WP JSON API. Page templates are in a folder partials/page.html and are accessed via ...
0
votes
0answers
78 views

Jquery Load with shortcode inside

I'm facing an issue to put my dynamic div working and i can't get no solution! In my child theme, I've a template which works correctly when page is created: <?php get_header(); ?> <script ...
0
votes
0answers
18 views

How to display .ptm file in my WP site without JAVA

I created a wordpress site which displays Polynomial Texture Map (.ptm) using Java PTM viewer developed by Hembo Pagi. See here. It uses WP shortcodes, so to embed my file by just write: [rti ...
4
votes
1answer
72 views

How can I allow for multiple template views on the Gallery Settings page when using the Visual Editor?

I'm trying to extend this answer by making it possible to switch shortcode attributes from the UI and alter the gallery markup based on those attributes. [gallery owl="true" link="none" ...
0
votes
1answer
30 views

Create a Wordpress shortcode using PHP [duplicate]

I am currently using the following code within single.php (after the_content) This gets the store_name from custom field as $merchant from the post and then returns a list of products from that ...
0
votes
1answer
33 views

How can I get the permalink of a page on which shortcode has been used

I want to redirect users to a page on which a particular short-code has been used after they login. So basically I want to know how can I get the permalink of that particular page on which my plugins ...
1
vote
1answer
25 views

Creating multiple enclosing shortcodes and fixing JS issues on click

I have the following shortcode to create multiple 'more' sections in any page/post: function more_shortcode( $atts , $content = null ){ return '<div id="more-outer"><a href="#" ...
2
votes
1answer
34 views

Call a custom field in an audio shortcode?

I'm attempting to call a custom field in an audio shortcode. The field I'm calling, enclosure, defines MP3 files that are associated with my respective posts. I'm using the PHP template editor in ...
1
vote
2answers
42 views

Replace / Remove Shortcode after 1st run / post

I want to use a shortcode to replace it with an image form a url. My idea: [shortcode url="http://google.de/aImage.jpg"] I post this shortcode usinbg IFTTT. After publishing the article the ...
1
vote
2answers
51 views

Set Post Image Using Shortcode

How can I set a post's featured image using the content of a shortcode? For instance, the following shortcode should set the post's featured image to the image at www.google.de/nicepic.jpg: ...
1
vote
0answers
15 views

Print shortcode in defined area

I would like to make shortcake to work that it would be possible to print in certain areas (sidebar, footer or normally in content). In templates I have two places with do_shortcode function (sidebar ...
1
vote
0answers
28 views

wordpress 4.4 self hosted video (html5) doesn't show

I was developing WP theme on my localhost (version 4.3). The client wanted to be able to add self-hosted videos. So I wrote shortcode and implemented it in Visual Composer. Basically, this shortcode ...
1
vote
2answers
62 views

My simple custom shortcode is not longer working (possibly due to upgrade to WordPress 4.4 ?)

I have a simple function in functions.php that creates a custom shortcode: function my_line_break() { return "<br>"; } add_shortcode( 'new line', 'my_line_break' ); Now, I don't know if ...
1
vote
1answer
47 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
123 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
21 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
21 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
45 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
50 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
42 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
84 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
37 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
48 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
176 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
99 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
52 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
53 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
58 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
132 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
75 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
58 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
146 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 ...