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

How to print a shortcode? [duplicate]

I have a shortcode [foo id="1"]. I want to display the usage of this shortcode without using the shortcode itself in this single case. Is that even possible?
0
votes
0answers
128 views

shortcodes not working -they just display as raw shortcode (code)

I'm developing a plugin and need to implement shortcodes, the shortcodes is coming out as it is on a archive/category page - I have used to the shortcode_exists(); to check if the shortcode does exist ...
0
votes
1answer
47 views

Why function hooked using object are executing at all time?

I tried to use class and object in plugin. I made a simple function with a shortcode but it is executing the function without pasting the shortcode to any page/post. class example{ function ...
1
vote
1answer
219 views

basic shortcode - Why 1st paragraph not wrapped in p tag, but 2nd is

I'm working on a basic plugin that adds shortcodes for columns, buttons, panels, ect. Nothing new here. I haven't altered wpautop in anyway; I've tried removing it and delaying it - no change. What ...
0
votes
1answer
48 views

How can I create a custom shortcode that will return a custom post type by ID?

Please excuse my ignorance, this seems simple but I can't figure it out and I've been rushing to hack things together. I can't find anything online to help me out. What I have: A custom post type ...
0
votes
1answer
314 views

Adding a custom field to do_shortcode [closed]

I think this will be pretty easy to answer...My php knowledge isn't great! I have used the Advanced Custom Fields plugin to create an 'add Slideshare shortcode' custom field in my page. The user ...
1
vote
2answers
190 views

How to filter backend post list showing only posts having a shortcode

I need to filter the Posts and Pages tables in the Admin panel by certain shortcodes. In my plugin, I have added a column for shortcodes to the Posts and Pages views that works like the "Categories" ...
0
votes
1answer
50 views

What is this format called (nested shortcodes)?

When using plugins and commercial themes in WordPress, it's not uncommon to meet code like this: [one_half] [service_box] <h1>Title:</h1> <ul> ...
0
votes
0answers
42 views

How to make shortcodes parse in two different themes

I've got a mobile and a desktop theme for my website , but the shortcodes in my desktop theme are a lot more functional than the ones in my mobile theme, I use only the shortcodes in my desktop theme, ...
0
votes
2answers
186 views

Video shortcode inside tabs shorcode NOT working

I have the "video" shortcode and the "tabs" shortcode. [video]code youtube[/video] [tabs] [tab title="text"][/tab] [tab title="text"][/tab] [/tabs] If I write the video shortcode into a tab, the ...
0
votes
0answers
110 views

Do_shortcode on PHP file outside theme ALMOST works

I recently incorporated a new interface into my wordpress site that mimics an iGoogle layout. (If interested, It can be found here: Link and DEMO ) It uses several widgets to make up the layout ...
0
votes
1answer
134 views

Get custom posts with certain ids in a custom loop using a shortcode

So I'm using custom loop and shortcode to insert it in any page. Like this: function register_custom_shortcode($atts){ extract(shortcode_atts(array( 'ids' => '', // this is what I ...
1
vote
1answer
87 views

esc_attr not working in shortcode

I have a shortcode that outputs a block of html. One element in the block is an anchor tag with an image caption in the title attribute. Some of the captions I am using have double quotes in them, so ...
0
votes
1answer
61 views

How to activate a plugin on the activation of a theme?

I want to use the hide unwanted shortcodes plugin to hide unwanted shortcodes from my desktop theme when my website is visited by mobile users. I'm currently using the any mobile theme switcher ...
2
votes
0answers
304 views

Custom media upload content for inserting custom post shortcode

I’m working on a plugin that creates custom post type “portfolio” along with shortcode to insert in any page or post. The shortcode is: [portfolio option1=“1” option2=“0” option3=“1” ] And it works ...
0
votes
1answer
65 views

Problem with height in video shortcode

i think there is a problem with the video shortcode. When i use [video src="" height="400"] the 400px height not work. The width work correctly but the height nothing. Is it a bug?
0
votes
2answers
62 views

Problem with shortcodes in external file

I have simple post with a shortcode: [xx]http://harrix.org/1.txt[xx] And an external file which has the content containing a WordPress shortcode: [strong] g[/strong] I try add my own tag to load ...
0
votes
1answer
51 views

Shortcode displays only default attribute values

For some reasons every shortcode, that I try to add to functions.php, displays only default attribute value and ignores what I specify in a post. E.g.: function my_shortcode( $atts ) { extract( ...
0
votes
1answer
130 views

Modify function Shortcode_atts

function get_date_posts($params, $content){ $default_params = array( 'post_type' => 'post', 'order' => 'asc', 'orderby' => ...
2
votes
2answers
484 views

Creating Multiple wp_localize_script for Shortcode?

I have a shortcode that displays recent WooCommerce products in a carousel, however i would like the end user to be able to use the shortcode multiple times on the same page, currently when this ...
-3
votes
1answer
49 views

How to create shortcode of this PHP code

I tried a lot but failed to create shortcode of this PHP snippet: <ul> <?php $my_query = new WP_Query('post_status=future&order=DESC&showposts=10'); if ($my_query->have_posts()) { ...
0
votes
1answer
58 views

Function shortcode - Set Parameter

function get_gifts_posts($params, $content){ $default_params = array( 'post_type' => 'post', 'order' => 'desc', 'orderby' => ...
0
votes
2answers
175 views

Video shortcode - autoplay all videos

How can I autoplay all videos added by video shortcode? I can make only one of them autoplay if only one has autoplay attribute set to 1, and others to 0, otherwise all are stopped.
0
votes
1answer
61 views

How to remove shortcode(s) from WYSIWYG Page editor for Non Admins

Title says it all. We have a front end form on our site where users submit content via front end (also they are logged in while doing this) Because these short codes add them self to the content box ...
0
votes
0answers
105 views

Using the same shortcode to show any table from the database

I have a little question for you. I want to create a shortcode that makes a table with data that I have stored in a database. But i want to send the shortcode an attribute, to specify which table ...
0
votes
2answers
51 views

Add Shortcode tag in Widget/Sidebar

I want to add a shortcode tag in the sidebar/widget. I am able to get the required functionality if I add the code in the theme's function.php add_filter('widget_text', 'do_shortcode'); My problem ...
0
votes
1answer
70 views

Shortcode registered from a plugin not recognized

I'm coding a really simple plugin to add some slideshows to my theme. I also want to register a shortcode to invoke them from my pages. So far I have this: class Slideshow { public function ...
0
votes
0answers
55 views

how i can make recursive wp_query and work

What i have done so far is: on single post page i have a box with 3 recent posts, i use WP_Query and reset with wp_reset_postdata(); i have made a shortcode that displays recent posts, i use ...
0
votes
1answer
305 views

do_shortcode() won't return PHP Array

I have made a shortcode [get_clients] which is supposed to return an array of all the clients when called via do_shortcode('[get_clients]'). But all it returns is a string 'Array' only. Why?
0
votes
1answer
65 views

How to support extra color options for shortcodes?

I'm creating a WordPress theme and it's almost complete. I've created few shortcodes for some of the elements, including buttons with different color options like blue, green, red etc. What I want now ...
1
vote
0answers
76 views

Shortcode default attributes over-riding non-default attributes

I have a shortcode with default attributes. It works fine with the default attributes, but the user-entered attributes do not over-ride the default attributes. Here is my shortcode code: function ...
0
votes
0answers
110 views

WP sql query to extend Groups shortcode to return list of users AND usermeta

This is a question related to an answer posted here The above solution outputs a list of a specified Group members' display names. I need to extend it to show 2 user fields and 1 usermeta field. So ...
2
votes
1answer
104 views

Applying filters to the_content() to separate content if any `add_shortcode()` is found?

I don't even know if this possible, with array_map or str_replace, but the idea is the follow: This function gets the content and before is sent out, clean_custom_content, there is where i cant ...
1
vote
0answers
268 views

Shortcode in posts called by ajax is not working

I am using ajax to load content of post. Functions like the_title() works fine, but unfortunately the_content() doesn't returns any shordcodes( gallery nor tablepress ) data. here is my code: ...
0
votes
1answer
19 views

Including template in shortcodes

I am creating plugin that display a quotation From. public function qt_shortcodez() { $QT_Options = get_option("qt_settings"); $Form = '<table> ...
1
vote
1answer
145 views

Super simple shortcode not working

Have been looking at various tutorials and answers here and elsewhere and just can't get this to work. Just trying to display a simple output from a shortcode as below, but it is just outputting the ...
1
vote
2answers
618 views

How to add shortcode tags in single.php

In my theme has one shortcode tags to display tags of post and function to load content post. But in function doesn't include shortcode tag. Now I want to add it to function but i don't know how to do ...
0
votes
0answers
108 views

Using Post ID and Page ID in same function

I've written a function to display a custom sidebar, which is outputted as a sidebar. On some pages, I have a Custom Field called 'show_sidebar', which I can assign as 'false' on pages which I do not ...
0
votes
0answers
49 views

Wordpress - Shortcode or Merge tags

I want to use shortcode feature. The only issue is that, I am having multiple parameters. The code I have till now is : add_shortcode('lorem', array(&$this, 'lorem_function'), 10, 1); ...
1
vote
1answer
118 views

Gist shortcode is not working

I freshly installed a brand new Wordpress for testing purpose as I am intending to refresh my current website. One of the requirement I have is to be able to embed code from Gist. Following the ...
2
votes
1answer
134 views

Allowing shortcodes inside attributes

I want to do a Wikipedia-like infobox for some articles on a WP site. I guess the most logical thing to do it is to use a custom shortcode—one that returns a table-like markup with a fixed order of ...
0
votes
1answer
46 views

How to Set Limit with WordPress Get Bookmarks Shortcode

I just need some help with a WordPress shortcode function. I would like to create a list of links based on the link_category inside a post with a shortcode. I had the shortcode working until I added ...
0
votes
1answer
103 views

Processing a login/register form before shortcodes are rendered?

I am building a custom login and register form in the theme of my client's website, and I need to process any error messages into a variable that can be displayed on the page within the form. I am ...
0
votes
1answer
114 views

Shortcode and variable

I need some help, this may be a noob question, I am trying to add a string variable into my short code. Here is what I have so far: $instagram_title = get_post_meta(get_the_ID(), 'instagram_title', ...
0
votes
1answer
106 views

Pull random comment from specific post, display on homepage with shortcode

I'm trying to display a random comment from specific posts on my homepage, using the solution that was provided here: ...
0
votes
1answer
29 views

Custom Post Type or Shortcode, What to choose? [closed]

While developing a multipupose theme for mass audience, i’m facing an issue. I’m going to code staff listing section. Now i was wondering, what should i do? 1: Create dedicated Custom Post Type for ...
1
vote
1answer
184 views

Remove specific shortcode from get_the_content()

I have a variable like this: $post_content = get_the_content(); Here i want to remove some specific shortcode from the $post_content variable e.g i want to remove only this [video height="300" ...
0
votes
1answer
46 views

Transform php shortcode into a widget [duplicate]

I have this bit of php that calls a short code with the date of today in the format i need. <?php $today = date('d.m'); echo do_shortcode('[table id=1 column_widths="10%|10%|80%" ...
0
votes
0answers
538 views

Set thumbnail from URL, by grabbing image in functions.php

So I've written a whole bunch of functions, which are used to display Vine videos. I then have a shortcode which outputs the code. The last thing I have to do is set the post thumbnail. I want to be ...
0
votes
1answer
63 views

Overwriting a Shortcode

I have a theme that extends the Visual Composer plugin with a slider on the front page. The slider will show five testimonials from five different customers. I want to add the featured image of each ...