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
3answers
32 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 ...
0
votes
0answers
20 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 ...
0
votes
0answers
12 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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
29 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 ); ...
3
votes
1answer
27 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 ) { ...
0
votes
0answers
30 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 ...
0
votes
1answer
26 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 ...
0
votes
0answers
12 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
27 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', ...
1
vote
0answers
23 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
14 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: ...
4
votes
0answers
54 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 ...
1
vote
1answer
29 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 ...
0
votes
0answers
25 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 ...
0
votes
0answers
26 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
20 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
17 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
70 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 ...
0
votes
0answers
18 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 ...
-2
votes
0answers
24 views

Shortode not working in general settings

I am trying to add a shortcode in the general settings of my site for "Site Title". What is the necessary add_filter hook?
0
votes
0answers
9 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
19 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
28 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
0answers
29 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
15 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
17 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
56 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
14 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
57 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
37 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
17 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
44 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
72 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 ...
2
votes
1answer
88 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
29 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
12 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
39 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
45 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
44 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
66 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
35 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
34 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
20 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
31 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
41 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
15 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
36 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
29 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 ...