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

Passing variable in nested shortcodes

How can I pass style attribute of [boxes] shortcode to [box] shortcodes without using global variables? I don't want to use global variables, because I saw on a few articles that using global ...
0
votes
0answers
10 views

Getting Custom Attachment Meta Data from Custom Media Manager

I have a custom shortcode button which opens the media manager and allows you to insert an image into the post: (function() { var file_frame; tinymce.create('tinymce.plugins.customButtons', { ...
-1
votes
1answer
24 views

Shortcodes don't in my theme

My theme doesn't display any shortcodes. I'm trying to add sliders in my posts... they need shortcodes so they aren't working as well. How can I fix that? www.ahseamodapega.com.br
0
votes
2answers
195 views

Problem using $var for shortcode attr value

I am trying to pass a variable value to a shortcode attribute. I can't get it to work. Is the following supposed to work, or must values be literal? $mycat = 'books'; $myshortcode = '[products ...
0
votes
0answers
21 views

Pass Variable from Function to Shortcode

I realize that this may be as much of a PHP issue as a WP issue, but I'm posting it here because it does pertain to shortcodes and have some WP-specific functions mentioned. Basically, What I'm ...
0
votes
2answers
524 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 (...
-3
votes
1answer
33 views

How to execute the “Visual Composer” code on a custom html page?

Visual Composer is an essential plugin for creating a website with Wordpress. I created an html page with Sublime Text without using the tools offered in Wordpress and without using Visual Composer. ...
2
votes
2answers
583 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 ...
0
votes
2answers
32 views

What is the correct syntax to append a URL using a shortcode for an iframe?

I need to iframe a series of content on our site. I need to pass on the the user information via a URL - vendor request. I have tons of shortcodes that display the username. It works fine. But ...
0
votes
2answers
38 views

Running Filter or Shortcode Before Query Prevents Excerpt from Showing

I've been wrestling with some code cobbled together for a function I found, first published circa 2009 and my inexperience with PHP has me at a loss. The function is designed to count episodes in a ...
0
votes
1answer
39 views

Shortcode to eliminate <p> and replace </p> with <br>

I have a filter that removes opening p tags and replaces closing p tags with a br tag sitewide. The client would like this filter in a shortcode that they can use only on specific portions of the site....
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 ...
-4
votes
0answers
37 views

shortcode from plugin only floats on top of the page, no matter where I place it [on hold]

I'm using the theme Divi, and a plugin called WP Membership. I'm attempting to add the shortcode for the enrollment and login boxes to the body of the page, http://brookeseggleston.com/learn, but ...
1
vote
2answers
790 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 ...
-2
votes
1answer
25 views

Can I prevent wordpress adding <p> and <br> tags to autoembeds

Cant give a reduced code example right not because my Advanced Responsive Video Embedder plugin is somewhat complicated. But the exact same code is used to generate the embeds, its just through ...
1
vote
1answer
6k 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
25 views

Shortcode call not working in WP Template

I'm working with a Visual Composer shortcode to call a text resizer into being. When using the Visual Composer or the classic WYSIWYG, if I insert it's shortcode [enlarge_text small='A' ...
0
votes
0answers
14 views

Generated short-codes don't seem to work

I'm using "Photo Gallery" plug-in and W3-data. Then there is a page where I want to display one gallery (of photos) per user. So using w3-data I generate the short-codes that I would like to have ...
1
vote
3answers
2k views

Run shortcode at certain resolution

I've gone a roundabout way of trying to ask a question about this here: Loading shortcode with ajax but figured it might be worth asking the fundamental question of what I am trying to do without ...
3
votes
4answers
855 views

How to display the site name in a WordPress page, or post

I'm trying to create a set of legal pages, that I can add to any WordPress site. Within these pages, I want to mention the site name. Is there a built in shortcode or something, that I can include in ...
0
votes
1answer
735 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 ...
-1
votes
1answer
570 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 $orig_shortcode_tags =...
0
votes
1answer
19 views

Object of class WP_Query could not be converted to int inside shortcode

I have the following code which is used to display download posts by the custom taxonomy. I am receiving the error Object of class WP_Query could not be converted to int When I have Query ...
0
votes
1answer
427 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 ...
2
votes
0answers
23 views

Remove and restore one shortcode

I would temporarily remove a shortcode, make something and restore it... it's possible? // override default wordpress "the_content" hook remove_filter('the_content', 'do_shortcode', 11); add_filter('...
1
vote
2answers
57 views

Shortcodes not resolved in AJAX call response

I have a simple function, which returns the content of a page with the given pageID: function get_page_content(){ $id = $_REQUEST['id']; $page_data = get_page($id); echo ...
1
vote
1answer
67 views

stop Wordpress removing shortcode from content

I've found that Wordpress is removing &nbsp; from my content, so from this page, I added the following to my functions.php: function nbsp_shortcode( $atts, $content = null ) { $content = '&...
0
votes
2answers
563 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 ...
3
votes
1answer
50 views

Stop strip_shortcodes() stripping content inside shortcodes

I have this shortcode: add_shortcode('refer', function($atts, $text) { $defaults = ['link' => '', 'nofollow' => true]; $atts = shortcode_atts($defaults, $atts, 'refer' ); $...
48
votes
6answers
10k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
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 ...
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 ...
10
votes
4answers
20k views

Stop WordPress automatically adding <br> tags to post content

Is there a way to stop WordPress from automatically inserting <br> tags when adding returns in the WordPress text editor. I would like for it to behave more like a code editor where I can ...
0
votes
1answer
741 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
1answer
530 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
40 views

Automatically add class-attribute to gallery?

I'm making a theme for a client in WordPress and he wants each gallery to have a grouped lightbox, so there's a lightbox for each gallery. I found out you can make it add an attribute to the gallery ...
3
votes
2answers
596 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
34 views

Custom Field 101

I'm trying to learn how to use the Custom Field function. I have a series of posts with titles like "Adams County," "Lane County," etc. All are in the category "Washington" and are tagged with "county....
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( $...
1
vote
2answers
624 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
618 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
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
2answers
559 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
3answers
55 views

custom field (video/audio url) and embed functionality

I was wondering if there is any way to combine a custom field (in custom post type) with an embed shortcode? Long story short - a user type into a field called videox and an url for a video (youtube, ...
0
votes
2answers
70 views

Shortcode is not outputting all of the desired markup

I'm having trouble getting my shortcode to output all of the markup - for some reason it's only outputting part of it. I have the following function: function shortcode_container($atts, $content = ...
2
votes
1answer
33 views

Is it possible to add a repeater field to TinyMCE's option window?

I am trying to create an accordion shortcode builder for WordPress using TinyMCE's editor.addCommand / windowManager.open function. I'd like to be able to add a repeatable region within the popup ...
0
votes
1answer
23 views

Gallery IDS and Captions: hide/show on a per ID basis

I am aware of hiding captions in a gallery via css on figcaption, like .wp-caption-text/.gallery-caption for example. What I am looking for is a way to have custom control of hiding captions on ...
0
votes
3answers
51 views

Wordpress shortcodes & performance

Do shortcodes affect performance? each plugin using this technique has to parse post/page content looking for the shortcode? If so, it would be better to limit as much as possible shortcode-based ...
5
votes
1answer
60 views

How to customize a shortcode using the customizer

General context: I have a plugin which implements a widget and I would like to make the widget into a shortcode. The widget has many options some of them mutually exclusive, and it is never good UX ...
1
vote
1answer
19 views

Setting youtube size in functions.php

I'm using the code below to set the width and height of youtube embeded links ////////////////////////////////////////////////////////////////// // Youtube shortcode //////////////////////////////////...