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

Modify function Shortcode_atts

function get_date_posts($params, $content){ $default_params = array( 'post_type' => 'post', 'order' => 'asc', 'orderby' => ...
2
votes
2answers
437 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
47 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
57 views

Function shortcode - Set Parameter

function get_gifts_posts($params, $content){ $default_params = array( 'post_type' => 'post', 'order' => 'desc', 'orderby' => ...
0
votes
2answers
156 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
53 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
92 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
49 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
65 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
52 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
281 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
63 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
102 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
101 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
249 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
18 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
144 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
556 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
104 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
48 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
106 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
119 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
45 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
100 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
101 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
103 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
167 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
44 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
520 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
62 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 ...
0
votes
1answer
78 views

Shortcode to output get_header not working

I'm trying to create a shortcode that will output the contents of one of my template header files. I created the shortcode in my functions.php file function zoo_header(){ return ...
0
votes
0answers
18 views

Nested WordPress shortcodes

Can I pass attributes from a shortcode to a nested one. Example: [row $number_of_cols=4] [col] $width=total_width/$number_of_cols; [/col] [/row]
0
votes
1answer
258 views

How to create a custom shortcode for custom login form?

I am trying to create a shortcode for the login form to use on a page. I have manage to get a simple form, but am looking to add the "forgot password link" Here is what I have so far ... any way to ...
0
votes
2answers
46 views

How to find out what handler is registered to a shortcode

I would like to be able to programatically find out what handler is registered to a particular shortcode. I want to be able to find this so I can save it, change it, perform a do_shortcode, then ...
1
vote
1answer
372 views

Hide Default Video Shortcode Controls on PageLoad

In wordpress 3.6+ when we use default video shortcode [video], controls of video are always visible on pageload. How can we hide these controls on page load and show only when we hover over the video ...
1
vote
1answer
472 views

Get custom post type list for every category shortcode

I am trying to make a shortcode to list all custom posts under the category they are under. Here is my code and I am no expert of coding but i thought that this would work. If someone can tell me what ...
1
vote
1answer
116 views

Remove hyperlink on gallery shortcode

I use a gallery shortcode in my index.php (theme directory) to display 3 boxes of images. The images are fetched from my Media. <div class="well well-clear" style="padding-bottom: 0; ...
1
vote
0answers
256 views

do_shortcode via ajax

I try to call contact-form-7 via ajax with do_shortcode. But it shows just "shortcode code". function example_ajax_request() { // The $_REQUEST contains all the data sent via ajax if ( ...
0
votes
0answers
128 views

Using get_terms() as shortcode attribute

Hop you pepople would be fine. I'm creating a shortcode with the following code. $categories = get_terms( 'project-type' ); foreach ($categories as $category) { ...
3
votes
2answers
6k 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 ...
1
vote
1answer
49 views

Shortcode for latest -not expired- posts

I've made a short code (part of a plugin) to display the posts which aren't expired. For saving the expiration date, i made already a meta key called newsbox-date. Handy for micro-news, short ...
0
votes
2answers
51 views

Strange get_the_* behavior with php 5.4

Let me try to explain what happened to me : I have a shortcode plugin which display child pages of the current page (a mod of http://wpist.me/wp/child-pages-shortcode/, very useful). In the display ...
0
votes
1answer
39 views

How to show an image via shortcode

Can anyone tell me,how to show an image via shortcode.I mean when I use my shortcode,an image will displayed.(shortcode example: [smile] and image location mytemplate directory/images/smile.png)Sorry ...
0
votes
1answer
119 views

Adding a cover image to video shortcode

I'm looking for a way to allow the user to add a cover image (a.k.a. thumbnail) to an internal video, uploaded to WordPress and embedded with the shortcode [video]. So far everything I came up to is ...
1
vote
0answers
13 views

Widget not displaying in WMPU sites

I'm modifying a theme for a WPMU install, and I've hit a wall. In order to display a text widget in a specified area, I'm using: $args = array( 'before_widget' => '<ul ...
0
votes
1answer
201 views

How to load a plugin when doing an Ajax call? [duplicate]

I have posted this question: How to use shortcodes on a widget sidebar when doing an ajax call?, with no answers. Now I want to ask a more specific question. The problem seems to be that the ...
1
vote
1answer
224 views

Calling a shortcode in the backend

I'm using TablePress to make some backend tables. What I want to do is show these tables in a different admin menu than the TablePress menu, because they'll be available to lower user groups. So I ...
0
votes
0answers
118 views

How to use shortcodes on a widget sidebar when doing an ajax call?

I'm trying to use a shortcode from Promotion Slider Plugin inside a widget when doing an ajax call. As said here, I could achieve it doing: add_action( 'init', function() { ...