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
2answers
36 views

Need to turn this php into WP shortcode

I need to turn this code: <?php if ( function_exists( 'echo_ald_crp' ) ) echo_ald_crp(); ?> into a shortcode. Can someone help me do this? I have researched but am just lost to be honest. ...
0
votes
2answers
260 views

Unable to process php via shortcode

I've been searching around for a fix to this and while I definitely have a much better understanding of my issue (thanks to similar queries posted by others) I am still not sure of the solution. I am ...
3
votes
2answers
600 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
2answers
28 views

How can you alter the name of attributes in a shortcode?

I'm trying to write a shortcode for a button, here's how it looks /** * Button Shortcodes */ function btn_shortcode( $atts, $content = null ) { $a = shortcode_atts( array( 'class' => ...
0
votes
1answer
24 views

PHP Helper Class to create shortcodes

I created a helper class to extend other classes for shortcodes. When I try to use $this in the add_shortcode() function I'm getting this error: Using $this when not in object context How can I ...
0
votes
0answers
27 views

Is it possible to change wordpress shortcode via javascript

Is it possible to change wordpress shortcode via javascript. Conditional shortcode like shortcode value=true if checkbox is checked else shortcode value=false if checkbox is unchecked
0
votes
0answers
16 views

Why WP Query Multiple Shortcode not working on same page?

I created a Shortcode slider which gets ids of different pages and show display slider. Shordcode works fine but issue is that whenever i am copy past shortcode multiple times on same page/ template ...
1
vote
1answer
34 views

Disable oEmbed for a Single Shortcode or at Least All Internal Links

Is there any way to disable the oEmbed functionality only for a specific call of the do_shortcode() function in just one script or if that is not possible can it be disabled for all the internal links ...
1
vote
2answers
807 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
votes
0answers
8 views

Custom shortcodes for Events Manager

I've extended Events Manager plugin with a few Custom Attributes for the location, e.g. locationcategories or opening times. Now I want a shortcode for a list of all locations with a specific ...
0
votes
0answers
18 views

Adding a term to a listing inside of shortcode that otherwise contains permalinks to custom post items with custom field values

I have this shortcode to output all items of custom post type "song", on a page listing all the songs a musician released throughout his career. // Custom shortcode, to query tracklistings on the ...
0
votes
1answer
749 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 ...
8
votes
1answer
136 views

Add self-closing shortcode button to TinyMCE in WP 4.6

I'm familiar with creating self-closing shortcodes like: // shortcode function wpse_shortcode_example( $wpse_atts ) { // Attributes $wpse_atts = shortcode_atts( array( '...
1
vote
1answer
2k views

Audio and video shortcodes not working properly

I'm having some trouble with Wordpress's built-in shortcodes for audio and video. When I embed a video, it basically gives me a black box and has a link to download the file at the top; when I embed ...
1
vote
1answer
27 views

Create a shortcode to display custom post types with a specific taxonomy

I created a page template to list all products of a specific product line. Now I want to list all posts from this custom post type (products) based on the taxonomy described in the shortcode for each ...
1
vote
2answers
408 views

How to load shortcode sooner

I am trying to add a shortcode to my menu, the menu item shows up but not the shortcode output. I think the problem is that the shortcode runs after the menu has run and therefore the shortcode ...
-2
votes
0answers
10 views

Adding a expand collapse effect to a thumbnail in Wordpress

I really new into coding in PHP for WordPress and I want achieve something: I have a isotope grid, made with this plugin for wp: "wanna isotope" and I want that every thumbnail in the grid that the ...
0
votes
1answer
446 views

Input with spaces in Shortcode attributes overwritten by defaults

question seems to be similar to the one asked here but the answer went down a different path. Pretty much if a user enters a shortcode attribute with a space it will get overwritten by the default ...
0
votes
1answer
409 views

tiny_mce_before_init preventing custom shortcode icon appearing

I'm using the following to trim the TinyMCE editor // Restrict buttons on the rich text editor function formatTinyMCE($in) { $in['remove_linebreaks'] = false; $in['...
0
votes
1answer
19 views

Search content for shortcodes and get parameters

In content I can have multiple shortcodes like [book id="1"] [book id="14" page="243"] Is there any help method with which I can search the content for that shortcode and get its parameters? I need ...
0
votes
1answer
540 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
753 views

Custom Fields - Boolean Display of True/False to Yes/No

I am importing fields from a Real Estate site. The Import of one Custom Field looks like this... Field Name after Import ---> assistedLiving Field Value ---> false to output the display in ...
0
votes
2answers
651 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 ), ); ...
0
votes
3answers
582 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 ...
1
vote
1answer
37 views

How to make WordPress use non-greedy shortcode parsing?

I made a shortcode that can be used with or without content. However, WordPress always looks for a closing tag. This is clearer with an example: [span class="foo"] [span class="bar"] [span class="baz"...
-1
votes
1answer
15 views

How get a shortcode working in category description

I want to use a shortcode for a table in a category description. It's my understanding that WP does not support this. I searched google and found some codes that i needed to add to the functions.php. ...
0
votes
2answers
731 views

How can i put an array as variable in shortcode_atts?

I am trying to create a shortcode with an array as input like so function product_gallery_shortcode($atts) { extract(shortcode_atts(array( 'product_id' => '31', 'prodvid' =...
0
votes
1answer
2k views

Adding shortcode to the main menu

Is it possible to add shortcode to a main menu? I tried the following but no luck? add_filter('wp_nav_menu_items','add_nwadcart_widget_to_menu', 10, 2); function add_nwadcart_widget_to_menu( $...
0
votes
1answer
26 views

How to modify WP Query to target the first most recent post to adjust content

I'm working with a function to grab the 3 most recent posts from the category "news" add_shortcode( 'show_news', 'news_query' ); function news_query() { $args = array( 'posts_per_page' =&...
0
votes
0answers
20 views

How to take parameters from a function and make them editable as attributes in a shortcode

I want to make shortcodes easily editable for the user, how can I modify this shortcode: add_shortcode( 'show_news', 'news_query' ); function news_query() { $args = array( '...
0
votes
1answer
13 views

Query Shortcode from a multisite to appear on a different site?

So, I have a map shortcode on a page template that is used like this: echo do_shortcode('[bgmp-map]'); The shortcode works great, but I was hoping to query the site that the shortcode displays, ...
0
votes
2answers
1k views

Insert wp gallery shortcode into custom textarea

Is there a way to insert wp gallery shortcode into custom metabox textarea ? I would like to have something like this: New metabox in post/page with textarea and below textarea there are a button to ...
0
votes
1answer
498 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
1answer
47 views

How to add attributes to a shortcode

Reading the codex, I have: function btn_shortcode( $atts, $content = null ) { $a = shortcode_atts( array( 'class' => 'button', ), $atts ); return '<a class="' . esc_attr($a[...
-1
votes
1answer
36 views

How do grab the main loop, with conditions, and output via shortcodes

I don't have any code for this because I'm not sure how to begin. I created a category called "News". On my homepage I want to show the 3 most recent articles, but I need to output them using a ...
0
votes
2answers
576 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
1answer
26 views

Shortcode: How to add custom posts?

I am having problems with post__in shortcode atts. It does not show anything. I think the problem is that post__in must be an array but the shortcode ID returns string. function courses_shortcode($...
-1
votes
0answers
12 views

Processing multiple shortcodes in one post at once

I'm creating a shortcode that needs to access the database. I'm expecting this shortcode to be used many times per post. This means it will access the database many times. Is there a way to get all ...
5
votes
1answer
67 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 ...
-2
votes
0answers
15 views

Multiple language shortcodes in php

Im new in PHP developing ,I want my slider is with multilanguage ,and I write some little codes lines ,but these doesn't work. CODE <? if (is_front_page() || is_home()) { wpml_e__if_language( ...
0
votes
0answers
21 views

Wordpress 4.5.3: How to remove shortcode from displaying in gallery post

#gallery-1 { margin: auto; } #gallery-1 .gallery-item { float: left; margin-top: 10px; text-align: center; width: 33%; } #gallery-1 img { border: 2px solid #cfcfcf; } #gallery-1 .gallery-caption { ...
0
votes
1answer
433 views

display custom portfolio tags

This is a part from the code that is used to display portfolio categories: $post_cat = array(); $post_cat = wp_get_object_terms($post->ID, "portfolio_category"); ...
0
votes
1answer
474 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 ...
3
votes
2answers
605 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
2answers
441 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 link</a&...
0
votes
3answers
638 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( '...
0
votes
1answer
23 views

Help With Creating Shortcode

I'm looking for a way to check just check for an option existing when executing a shortcode, but that option doesnt need a value. How do I just check for JUST an option? For example I tried this out, ...
-3
votes
0answers
32 views

How can I edit a woocommerce / visual composer shortcode? [on hold]

There's this element in Visual Composer: Product Category, which retrieves all products in a specific category. I would like to know where can I edit it, so I can modify its HTML output.
-2
votes
0answers
15 views

How to make woocommerce looping images of one product in the content-product.php

I need to put via woocommerce shortcode 'product' a product, and it must to change image (second image of product) when hover.There is the code of content-product.php: <?php if ( ! defined( '...
0
votes
1answer
35 views

using a shortcode in a hyperlink

I am trying to use a shortcode inside of a hyperlink <a class="wpb_button_a" title="Reserve Now" href="/reservation/?unitrate=[print_csv position="5"]&amp;unitsize=5%20X%205&amp;...