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

tax query shortcode

Configuring my shortcode with tax query is proving dificult. When i omit the params for taxonomy/terms i get nothing back. This returns 1 post back as expected [loop post_type="website" taxonomy="...
0
votes
0answers
91 views

Override shortcode in child theme

I want to change a shortcode behavior in my child theme. The shortcode.php location is: /themes/xxxx/framework/helpers/shortcodes.php the code inside this file is: class SH_Shortcodes { ...
-1
votes
2answers
73 views

Enclosing shortcodes create line breaks

I created enclosing shortcodes like this: //[rezept] function rezept_func( $atts, $content = null ){ return '<div class="drl-rezept-wrapper">'.do_shortcode($content).'</div>'; } ...
-1
votes
1answer
54 views

woocommerce Product shortcode create

i am very new wooCommerce and WordPress. programming knowledge not strong yet. but for my project i need to do something. now i want to create custom short code for woocommerce product. i want to ...
0
votes
1answer
54 views

Change the default video shortcode

When I select a video file from media library and click on insert in to post button that time it goes like this : [video width="1280" height="720" mp4="https://s3-us-west-2.amazonaws.com/bucketname/C-...
0
votes
1answer
77 views

Shortcode for Visual Composer Grid fails turning string to integer

I am working in a shortcode for visual composer grid. I want to show the list of terms of a taxonomy (portfolio_tag) associated to a custom post type (portfolio). The shortcode gets the ID from the ...
0
votes
0answers
36 views

TinyMCE custom button on post-new.php screen

Iam building a small slideshow plugin. For this I registered a new post-type which is called "prfx_slide". And also set-up a shortcode function so that I can use the slider as a shortcode. With the ...
0
votes
0answers
33 views

Override plugin shortcode declared as a Class

There is a class which is a shortcode from commercial plugin for WordPress I need override method /** * Rendering the shortcode this class is responsible for. * * @return string $...
0
votes
1answer
17 views

How to create an incremental list using shortcodes?

Right now I'm creating shortcodes like this: function short_code($atts) { $a = shortcode_atts( array( 'name' => '' ), $atts ); return '<div class="content"> <div class="...
1
vote
1answer
53 views

Using API to generate short link

I want to use a shortcode that generates a short URL from API of Premium URL Shortener script. I added code from API to my template functions: // Main Function function shorten_url($url){ $...
0
votes
1answer
35 views

Ordering get_terms with ACF not displaying all terms

I'm making a shortcode to return all the terms in this taxonomy. The terms are sorted with krsort by the custom field 'height' made from ACF. I'm following this answer from here. The problem is it's ...
0
votes
1answer
51 views

Trying to Understand Shortcodes.

am completely stumped on this for some reason. I have block of code that I had in my header.php <?php if ( is_page("Home") ) { if( have_rows('slider') ): ?> <div class="my-slider">...
1
vote
2answers
59 views

shortcode_unautop shortcode not functioning

I have made my own theme with shortcodes to WordPress. In my filters I have: remove_filter('the_content', 'wpautop'); add_filter('the_content', 'wpautop', 99); add_filter('the_content', '...
1
vote
0answers
43 views

Is it possible to delay execution of shortcode output callback?

I have a problem : shortcode output callback triggered too early. /* Defined in plugin constructor */ add_shortcode( 'foobar' , array($this,'pre_render_routine')); function ...
1
vote
1answer
62 views

Different loop output every x posts in custom post type

I was following along in another StackExchange Question from a couple of years ago where there was a layout along the lines of: <div class=items active> <div class=row> <...
-1
votes
1answer
39 views

Insert shortcode in widget area

I enabled the Insert Pages plugin wich allows to create a shortcode for a given page e.g.: [insert page='7' display='all']. See my capture of the setting of the plugin: https://drive.google.com/file/...
1
vote
3answers
48 views

How to use shortcode in js url

Here's the code I'm trying to use. <input type="button" class="next-step" value="Adopt Now" onClick="parent.location='http://example.com/adoption-application/?Name=[Title]'" /> The shortcode ...
1
vote
0answers
97 views

wp_reset_postdata() and wp_reset_query() inside shortcode are not working to reset original page query

I'm implementing a form for a frontend post with a shortcode. The form is processed in the same function, reloading the page: function adicionar_ninhada(){ $user_id = get_current_user_id(); if (isset(...
1
vote
0answers
27 views

Shortcode: text content ends up outside html tags

I have a shortcode which loops through a custom post type. It is supposed to output a link and a title for each post. But the result is that the divs and link tags that are created are empty, while ...
1
vote
1answer
57 views

Shortcode for CPT post content in a page

I use the Wiz theme along with a plugin I'm coding. The Wiz theme comes with Visual Composer bundled and theme options for pages (header, sidebar, footer and the like). However those options are ...
1
vote
1answer
37 views

Shortcode returning localized HTML part

Here's my issue. I made a shortcode which makes a related article section in post content. Here's the content of this function: $a = shortcode_atts( array( 'id' => 0, ), $atts ); if($a['id']...
3
votes
1answer
38 views

Wrap each shortcode in array to div

i'm trying to wrap each shortcode in div with special data attributes, but when i'm using nested shortcode they don't wrapped, where i'm wrong? thanks public function wrapShortcode( $content ) { ...
1
vote
0answers
99 views

Displaying recent posts on static page with template-part via shortcode

So, I'm taking my first shot at creating my own custom Wordpress theme with Underscores. I have everything straightened out, with the exception of one last thing I want to add. I would like to add a ...
2
votes
1answer
35 views

Remove HTML content if attribute is not set / variable attributes

So I'm creating a shortcode that uses the standard bootstrap carousel. It works completely fine as long as all the 3 slide attributes are entered correctly but obviously if only 2 are set and the ...
1
vote
0answers
70 views

What's the best way to render Visual Composer in posts, not pages?

I have a page with layout and ui content I'd love to use in my posts. Is that possible without running through all the shortcodes with do_shortcode?
1
vote
1answer
34 views

Custom Shortcode, functions PHP WP_Query loop

I have the following code in my functions.php file:- function featured_properties_func( $atts ) { $args = array( 'posts_per_page'=> -1, 'post_type' => 'properties', ...
5
votes
0answers
50 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 ...
5
votes
1answer
113 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
35 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
77 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 can'...
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
129 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
146 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
51 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 5'...
0
votes
0answers
35 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
202 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
47 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
173 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
55 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: [audio:http://localhost:...
0
votes
0answers
157 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
27 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
58 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
283 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
101 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 ...