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)

3
votes
0answers
44 views

Can I create customizer setting that can handle plugin shortcode?

Can I create a customizer setting which will handle a shortcode from a plugin? Do I violate and rules or guidelines in WordPress theme development? If it's possible what is the best way to sanitize ...
0
votes
0answers
19 views

woocommerce no shortcode for all products in one page

I like a list of all products on one page. So only per category. I have going through the shortcodes, but can not find the code for it. Looking into: ...
5
votes
1answer
109 views

Change appearance of shortcode text inside editor

Is it possible to change appearance of shortcodes in editor or in whatever way make it more distinguishable from surrounding text? For example if the content of a post is like this... Reference ...
2
votes
1answer
37 views

Why does WP not like my <a> container?

Lately I've been working on some shortcodes where all the elements the shortcode produces are wrapped inside an tag. Unfortunately this is not rendered like wanted, because of the filter wpautop on ...
1
vote
0answers
38 views

Edit shortcode in post content programatically

Let's assume there is a simple post. It has some content and a few [gallery] shortcodes in it. I need to add (or modify) attribute to specific shortcode and save in database (not temporarily modify ...
1
vote
0answers
34 views

Creating shortcodes in plugin

First time creating a WP app, so please bear with me. Essentially, I want to be able to input a value in a form, which gets processed and put into the database. Once that is done, I was trying to use ...
0
votes
1answer
62 views

How to show in front End images using Visual Composer attach_images?

$gallery = shortcode_atts( array( 'post_gallery' => 'Gallery', ), $atts ); $img = wp_get_attachment_image_src($gallery["post_gallery"], "large"); $output = "{$img[3]}"; I ...
0
votes
0answers
33 views

get author id outside loop for posts showed by shortcode in a page

i have a page (like: site.com/PAGE), and this page address will display all posts from all authors(posts are custom post type). if address contain the author slug like: site.come/PAGE/USER, display ...
1
vote
2answers
113 views

Change link in get_terms if there is only one post in the category

I created a shortcode that will list the categories in my custom taxonomy and will return a list of all the categories that have at least 1 post (not empty). The result is that when someone clicks on ...
1
vote
0answers
127 views

Visual Composer shortcode for child theme dir

I have a site using VC that is running on localhost and also on a staging environment. I need to access the child theme directory to call images from within raw-html sections of visual composer ...
0
votes
0answers
21 views

Plugin download monitor always links to same file

I installed the download monitor plugin to generate download-links for videos. I have created a couple of downloads and created a widget to display them. I can see the correct shortcode, when I use ...
1
vote
1answer
38 views

Having issues with a foreach inside of a shortcode with ACF gallery

Normally I would just put this type of content in a template, but the way I'm pulling in the content is a bit different. I made a shortcode which I've been having issues with. It's using Foundation ...
0
votes
0answers
34 views

Shortcode returns nothing

I have this shortcode, which for some reason returns nothing: function youtubes( $atts, $content = null ) { global $post; $ttt = get_field ( 'video_code', $post->ID ); $ttt = ...
1
vote
1answer
163 views

How to pass “get_the_terms_list” as shortcode to Visual Composer Grid Builder

I am trying to create a shortcode that returns the term list inside of Visual Composer's Grid Builder. I have read the docs here. My code is as follows: add_filter( 'vc_grid_item_shortcodes', ...
0
votes
1answer
18 views

Stop truncation of shortcodes in custom text fields?

I have a custom theme that a third party developed for me and I’m trying to get to the bottom of a problem with shortcodes. I’m fairly new to Wordpress and PHP so please let me know if there is any ...
1
vote
1answer
36 views

get_post_title is not working on homepage

My simple shortcode works on all pages except for the homepage (static) in Wordpress 2016 Theme. All content I can read except for the post title. It comes back empty. I want to display posts on ...
5
votes
2answers
150 views

Allow Shortcode in Theme Customizer

All theme dev who follows the wp guidelines properly, now uses ability of default wp customizer to customize their themes, instead of making a different theme option section the admin panel. But what ...
1
vote
0answers
50 views

Displaying Login form with Shortcode

So I am trying to display a working version of the default wordpress login form on one of my pages. There is code in the functions.php file that creates the shortcode and as far as I know it works ...
3
votes
2answers
68 views

Legacy Audio Shortcode

I have recently redone a site that was originally created in 2011. Of course there were a few big development issues and one of them is the usage of an old audio shortcode: ...
0
votes
0answers
135 views

Using Post ID in Visual Composer Element Builder

I would like to use a shortcode inside the VC element builder text field. The shortcode takes the given post's ID and prints some metadata from the Tribe Events Calendar Pro plugin. Here's the code ...
0
votes
1answer
24 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
57 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
215 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
97 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
211 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
14 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
77 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
64 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
53 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
105 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
41 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
37 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
53 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
93 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
20 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
76 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
28 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
37 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
44 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
29 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
63 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
54 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
139 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 ...