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
0answers
11 views

function of parent not working in childtheme

I have a plugin used on a parent theme which uses shortcode. The plugin (shortcode) works on the parent theme but when I switch to child theme it no longer works. I've only added the child theme code ...
1
vote
2answers
580 views

How to get specific string in explode array?

I have a shortcode where I'm trying to get a specific string from the $args array below. Query: $args = array( //'post_type' => $posttype, 'post_type' => explode( ', ', $posttype ), ); ...
-2
votes
0answers
8 views

Output Diffrent Tablerows after loading the same Wordpress Side with a Shortcode in the Content where the table will be shown

i know currently how i can add a shortcake for my Plugin that will output an table with 20 Rows of information and also a navigation bar for the previous 20 rows. But I still could not find out how to ...
-1
votes
0answers
17 views

product_categories shortcode order [on hold]

For a specific page I want to display product categories in the order I specify in the shortcode. I am not sure what to set in orderby [product_categories orderby"custom" number="16" columns="4" ...
1
vote
1answer
5k views

Auto gallery from folder contents

I want to create a WordPress shortcode that will add an automated gallery of the contents in a folder. I am currently trying to implement this in a site that publishes 12 annual magazine issues, so as ...
0
votes
1answer
430 views

How to create a shortcode for embedding pdf in iframe?

General information I am creating a site with WordPress. For the content I want that the PDF files can be embedded inside an iframe. So I first created a WordPress function to hook in ...
0
votes
3answers
573 views

Passing postid of Testimonial Custom Post in Shortcode Parameter

I am trying to create Testimonial custom post and display using shortcode function create_post_type() { register_post_type( 'testimonials',//new post type array( ...
1
vote
3answers
41 views

How do I apply style to each category of a list?

I need to create a simple plugin to show a list of categories inside the body of the post and, as I am new to coding, I searched for the basics and started to make little changes; it looks like this, ...
0
votes
0answers
23 views

Adding a query string to product links

I need to add a query string to the end of the links generated by a [products] shortcode from WooCommerce. Each product appears with three links. The image, the title and the add-to-cart button. I ...
3
votes
2answers
99 views

Search & Remove Specific Shortcode From All Posts

Question Is there a way to remove a specific shortcode, say [print_me] from all the posts where it appears in one shot. And I don't mean mask it or filter it so it doesn't show up while it stays in ...
0
votes
2answers
44 views

Why 'do_shortcode' doesn't work in a REST request?

Why do_shortcode doesn't work in a REST call ? In the example below, do_shortcode exists, but the shortcode isn't interpreted. Route declaration /* Adding a route with callback is ...
0
votes
1answer
36 views

Add custom shortcodes to the Welcome Mail

I need to add a custom shortcode to the welcome email of my website. I'm not expert; what I need is in plugabble.php file? I tried a lot of plugins for edit email template but nothing seems work. ...
0
votes
2answers
573 views

Custom registration form in shortcode getting internal server error 500

I created a custom registration form which works fine when used as a custom page template. I needed it as a shortcode so I created a shortcode using the function below /* Custom shortcode */ function ...
0
votes
0answers
28 views

Make shortcode work in all posts displayed by loop, not just the first one

I have a post archive displaying post and author meta at roadtripsharing.com/road_trip I added a do_shortcode(); in the loop, specifically related to the "New Message" button which opens a dialogue ...
0
votes
1answer
11 views

How to enable shortcodes in text retrieved from get_theme_mod

Is there a way to enable shortcodes in text saved in the customizer and retrieved using get_theme_mod? I'm guessing there's a filter in a similar manner to enabling shortcodes in widgets.
2
votes
1answer
662 views

Shortcode in AJAX popup

I am trying to use a shortcode from Ultimate Facebook plugin to display a FB connect button in an AJAX popup and can't seem to get it work properly. I searched and used the solution given by djb in ...
0
votes
2answers
522 views

Image and shortcode not showing in excerpt

I've paid to someone to create a theme for me. Everything works fine, expect the excerpt on category posts. It only shows an excerpt of the post ( not image ) and when I add a shortcode in the ...
0
votes
2answers
467 views

Passing variable as add_shortcode argument

I'm trying to pass a variable into the add_shortcode function to be used as the shortcode name but it does not seem to be working. Is there a way that I can pass a variable similar to this? foreach ...
0
votes
2answers
25 views

Push Shortcode parameter to template

I'm trying to push a shortcode parameter value to a template file but for some reason I can't get the array value that I'm targeting into a single variable. Here is my code and the shortcode I'm ...
0
votes
1answer
435 views

How to insert HTML/CSS/JS into my iframe plugin?

I currently have an iframe plugin that displays on a WordPress page by shortcode. Currently I have been displaying websites in my iframes "src" but I recently came across an issue to display my very ...
0
votes
2answers
419 views

Shortcode to find and replace URL

I'm trying to create a shortcode that will search within some specified text for a link and replace it with one that I specify. For example: [scode]Click on <a href="www.X.com">this ...
1
vote
3answers
4k views

Wordpress removing <p> tags?

I'd already come across a case where Wordpress added <p> tags. However now I'm dealing with the opposite situation. When I add [] shortcodes inside <p> tags WordPress automatically removes ...
0
votes
2answers
31 views

Is it possible to define variables in a wordpress shortcode, and then call the shortcode using a specific variable?

This is my first go at making my own shortcode. What I am trying to do I have 11 different outputs for star ratings I want to be able to use in posts. I want to wrap it all into one shortcode, and ...
0
votes
1answer
38 views

Pull in excerpt with shortcode

I am working with a plugin that provides a shortcode with only a couple of parameters. I'm using [list-shows] shortcode. I would like to also pull in an excerpt of the content. I was able to add in ...
2
votes
2answers
558 views

How to get shortcode working from custom meta field

I've created a simple text custom meta field for pages. I can successfully enter plain text which prints on the frontend of the site with no problem. I want to add shortcodes also. If I add a ...
-1
votes
0answers
28 views

Visual Composer - How do I modify a shortcode after page load? [on hold]

I have a grid shortcode built in Visual Composer (on a page by page basis) that I'm trying to modify after the page loads. I'm running a few regex statements to make sure it only matches what we need, ...
0
votes
1answer
5k views

Display custom post type with shortcode

I have made a custom post type for my WordPress Theme and a page where the custom post types are displayed. But does anyone know how to make a shortcode that displays posts of a custom post type?
0
votes
1answer
21 views

Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?

I am planning to purchase a plugin that allows users to create polls and then embed them via shortcode into posts. It looks like a great plugin all around; however, the functionality I would like is ...
0
votes
1answer
33 views

Load next post by ID on a single page

I hope this topic is not duplicated. I see some similar topics but non of them can solve my problem, so I decided to put a new one. Here's the case. I have a single.php post with the defualt ...
1
vote
2answers
752 views

Shortcode are not working in Option tree textarea

I am using option tree. In textarea, i place shortcode [layerslider id="1"] its not working, i also found same post replied by plugin author allow shortcodes in textarea in option tree applied ...
1
vote
1answer
798 views

wp_specialchars and wp_specialchars_decode in a shortcode plugin

I have written my first plugin, a shortcode plugin. I have read about wp_specialchars and wp_specialchars_decode but I'm not sure how to use them. The plugin read a shortcode allowing some parameters ...
0
votes
2answers
18 views

How to handle multiple nested shortcodes with different tags?

Hi I'm fairly new to Shortcode programming and was wondering if it is possible to process the following nested shortcode with different shortcode tags: [review] [title]Sample Review[/title] ...
3
votes
2answers
2k views

Customizing gallery shortcode in 3.5

I'm trying to customize the gallery shortcode using the new gallery system in 3.5 and I'm having a bit of trouble and can't figure out where I'm going wrong. This is what I've got at the moment (in ...
0
votes
1answer
16 views

How to reuse php templates as shortcodes?

I want to have a structure like: wp-content |themes |myTheme |page.php |contact.php |break.php In a page from WordPress admin, I want to ...
0
votes
1answer
166 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
2answers
32 views

Shortcode templates

I don't know if this is the correct way to approach this, but here it goes. I'm working on Visual Composer (but could be vanilla WP), and I'm trying to implement a shortcode which generates another ...
0
votes
1answer
14 views

How do I require a file in a shortcode?

I have a shortcode that is working and displaying the problem is that it jumps to the top of the page. If I have any text or other shortcodes above it in the page editor they will be displayed below ...
3
votes
1answer
1k views

TinyMCE popup windows using WP functions

In my editor I would like to use a TinyMCE generated popup to insert in the textarea some complex shortcodes. I use the TinyMCE API to show the popup (bottom of this question). The popup is a PHP file ...
7
votes
2answers
2k views

How do I escape a ']' in a short code?

How do I escape a right bracket in a short code? I'm working on a Google Map plugin that has encoded points. Sometimes the polygons have the ] in it, which makes WP think that it's the end of the ...
0
votes
1answer
691 views

WP_Editor Shortcode Issue

I have created a front-end editor using wp_editor that functions as it should. Upon testing I have noticed that it is stripping out any shortcodes that have been inserted in the content. I have ...
0
votes
2answers
516 views

HTML Inside of Shortcode Breaks Shortcode Output

Lots of Googling has still not yielded a solution. Here is the problem: I have created a custom Wordpress shortcode to use inside my Thesis theme. The goal of the shortcode is to allow users to wrap ...
0
votes
1answer
556 views

Wpautop stops working after get_the_excerpt

function pre_process_shortcode($content){ global $shortcode_tags, $shortcodes; // Backup current registered shortcodes and clear them all out ...
-1
votes
0answers
24 views

Losing my mind with [shortcodes], Divi Builder, and ACF (Advanced Custom Fields) [duplicate]

If that question title doesn't give you a headache, keep reading.... I have spent the past 12 hours trying to figure out how to keep the layout of the page just like it was with divi builder and ...
-2
votes
0answers
37 views

Is it possible to modify the the query of a plugin's shortcode externally(i.e without touching the plugin's sourecode)?

I'm using the Post Grid plugin which allows me to display my posts in a grid. This works perfectly however I want to create a custom template that displays the most recent post or a post with a ...
0
votes
1answer
33 views

latest posts shortcode with image

I am trying to make a shortcode that will take my latest 5 posts and render them on page. I get all the posts rendered correctly except for the image source, I receive it blank. Is it something I'm ...
1
vote
2answers
16 views

Create a widget to use shortcode?

I have a plugin (Social Warfare) that I love. But, there's no widget available. What is involved in creating a widget so that I can use the shortcode that seems to work fine on the pages and posts?
0
votes
1answer
27 views

How can I create another instance of my custom shortcode

I've created a custom shortcode which takes category slug and number of posts as parameters and creates a loop with WP_Query and outputs the posts from db. But I'm unable to use it more than one time ...
3
votes
2answers
572 views

Stray closing paragraph tag when using shortcodes

I'm using a basic shortcode to wrap some text in an expandable div. What appears to be happening is that the wpautop is inserting a stray closing paragraph tag at the beginning and a stray opening ...
0
votes
1answer
505 views

Using Custom Post Meta Values in Shortcode

I'm trying to display meta content from a custom post type in a shortcode. I'd like to simply provide a post_id and be able to display all the meta content. [my_shortcode post_id=""] I'm new to PHP ...
0
votes
1answer
19 views

Woocommerce products shortcode specific order

Is there a way to get products in the order of the IDs in the shortcode parameter: e.g [products ids="53,68,1"] Display block with 3 product, where 53 on first place, 68 on second...? Now I get ...