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

How to get_post_meta in a shortcode in excerpt on archive pages

I have a shortcode, [foo], which displays the value in a custom field. However, as it appears near the top of each post, it is included in the excerpt. function foo_shortcode(){ global $post; ...
0
votes
1answer
10 views

How to type shortcode-like text in WordPress TinyMCE visual editor?

Suppose, I have a plugin which is offering a shortcode for its users: [my-shortcode]. Now I want to post an advertisement in a page of my WordPress powered blog like the following: Hey you can use ...
0
votes
1answer
21 views

Change variable value for different shortcode attributes?

Suppose I have a function that needs to be able to load a file depending upon an attribute in a shortcode: [open_file ex1] How would I go about defining which file name is set as $csv depending ...
0
votes
1answer
30 views

Shortcode doesn't display in custom post type

I created a custom post type, but when i have added a shortcode for a slider it doesn't show the slider it shows just shortcode in text. and when i change get_the_content by the_content, it shows me ...
0
votes
0answers
21 views

Passing multidimensional arrays and associative arrays to plugin shortcodes

I want to pass complex structured data to a plugin I am creating. I have been using text strings in shortcodes with delimiters that are exploded into arrays by the plugin but things get increasingly ...
0
votes
3answers
36 views

Creating Wordpress Shortcode with Variable

please forgive me I'm relatively new to PHP... I would like to create a shortcode called [city-name] and have tried placing the following code in my functions.php file: function get_city_name() { ...
1
vote
2answers
30 views

Insert a custom field into a shortcode and use it in post(s)

I would like to insert a custom field into a shortcode and use it in post(s). I want the shortcode to be used with parameters. I tried to solve this problem but it displays the "Array" word instead of ...
0
votes
1answer
7 views

Display custom widget, added as a shortcode in the correct place

I've created a custom Widget and I would like to add it to the page content as a shortcode. function show_custom_widget() { the_widget( 'WP_Custom_Plugin'); } add_shortcode('custom-widget', ...
0
votes
0answers
12 views

How to get value from listbox in TinyMCE

I want to get the value in the listbox but it always return text value (Yes/No instead of True/False). This is my code: onclick: function () { ed.windowManager.open({ title: 'A Grid based ...
0
votes
1answer
55 views

Pagination fuction in shortcode always displays on top

Pagination function in shortcode always displayed on the top. Please have a look on below code /*-------------------------------------------------------------------------*/ /* Custom Pagination */ ...
0
votes
1answer
22 views

Shortcode for External HTML

I'm looking for a short-code that I can put in a page, that will open up a static external HTML file. The point is so I can update the file, and change the contents of the page with just uploading a ...
0
votes
0answers
22 views

How to change color of headlines within shortcode?

I have done my own shortcode for the layout of the page like this: (from the functions.php file) // One Half function layout_one_half($atts, $content = null) { $atts = shortcode_atts( array( ...
0
votes
0answers
14 views

About Wocommerce custom shortcodes [closed]

I saw this: Adding my own custom woocommerce shortcode to child theme, how? and i was wondering, the really short script at the end of the page, function shortcode_handler($atts) { //code ...
0
votes
2answers
25 views

Adding a class to shortcode API

So, I have the following shortcode which is included in two different pages. <?php echo do_shortcode('[shortcode]'); ?> Since two pages are using one identical shortocode, I am thinking of ...
0
votes
1answer
14 views

Wordpress upgrade adding additional quote marks to shortcode output

Since upgrade to 4.1.1, Some shortcodes are now playing up. IE The HTML output. Below is in the functions file for producing TABS. ...
0
votes
1answer
11 views

How to implement theme shortcodes in text outside of pages?

I am working on a project where the admin can enter text that will be presented in a custom template. Once the text is written it is saved to the dB then pulled out and presented when needed. The ...
0
votes
0answers
12 views

Shortcode Menu plugins default value

I use Shortcode Menu plugins, everything works fine. When I'm using a smartphone, the menu is responsive but the default value is the last value of the Menu. I would like that the default value is ...
0
votes
1answer
45 views

Shortcode to return an image based on post taxonomy

here is my first question here ! I learn a lot reading question an answers here, but I still have a lot more to learn... So, I want to create a simple shortcode, to return an image "If this ...
0
votes
0answers
33 views

Inserting a variable into a shortcode inside php

$idstring = do_shortcode( $cb_video_url ); long story short, this gets the YouTube video ID from a given url (example: 5kx45jHqQ ) and there is a youtube embed plugin for wordpress that uses the ...
-1
votes
1answer
20 views

Passing HTML in WordPress Shortcode arguments

I've searched a lot but didn't find a solid answer for my question. So I'm posting a new one here. If someone know how to do it, please answer it with an explanation. Lets say I have a shortcode ...
0
votes
2answers
61 views

Specific loop in Shortcode

I'm making shortcode and I'm stuck here. Here is code: add_shortcode('service-shortcode', 'service_shortcode'); function service_shortcode($atts) { extract( shortcode_atts( array( 'title' => ...
-1
votes
0answers
28 views

Embed facebook post via shortcode and store in transient

I have created a shortcode to embed facebook posts within Wordpress and it seems to work as expected. I would like to expand it to cache it in a transient with refresh every hour. This is what I ...
0
votes
0answers
15 views

Special characters get auto replaced

When I create a new post in WordPress and I publish my post, everything is OK. But when I try to edit my old post, the code in [code] has changed. For example " changes to &quot; and < ...
0
votes
0answers
15 views

Extract a WordPress shortcode attribute from function and apply in another one

I try to modify simple AJAX contact form so that it could take shortcode arguments. Specifically I need to send a message about the successful submission of the form, and as well error message based ...
0
votes
0answers
22 views

Custom Login in Shortcode got error

I am creating a shortcode that having a login form but it seems I got error when I try to login. this is my code. function postCustomWPLogin($username, $password){ $creds = array(); ...
0
votes
1answer
18 views

Trying to get property of non-object in shortocde

I'm having error in shortcode that "Trying to get property of non-object" on line no 130 Here is code: while ( $our_work->have_posts() ) { $our_work->the_post(); $termsArray = ...
0
votes
1answer
12 views

Wordpress shortcode Issue!

Hi I have developed a shortcode that lists posts from a custom post type depending upon taxonomy terms. But I am having an issue. It's displaying all posts from all terms instead of the terms being ...
0
votes
1answer
36 views

Problem in outputting shortcode

This is my 2nd question about shortcode as I'm learning shortcode. Here is my code: add_shortcode('work-shortcode', 'work_shortcode'); function work_shortcode() { $return_string .= '<div ...
0
votes
0answers
17 views

why full page is being feedbacked when using ajax?

Having kind of strange problem. The code i'm using in the plugin is as below //user login form add_shortcode('ajax_login', 'atest'); function atest(){ global $load_js; $load_js = true; return ...
0
votes
1answer
12 views

Shortcode for showing childpages

I found this code snippet that shows childpages only. It works great, doing exactly what i intend it to do. I want to be able to place this around the site, but i cant place PHP inside the Rich-text ...
0
votes
1answer
19 views

How to Get Shortcode in Excerpt to follow Document Flow

I have the following Post - Excerpt: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sagittis augue sed orci efficitur convallis at sit amet lectus. [my-short-code] I have the ...
0
votes
1answer
30 views

Problem in shortcode outputting content

I`m trying to make a shortcode that output the a div containing content from Custom Post type . I'm able to output the content but content does not output within div . the shortcode output the div and ...
0
votes
0answers
29 views

Placing PHP inside Theme Accordion

I have already posted this on Wordpress.org support (with no response yet) however on the advice from someone they thought this website maybe better suited. I realize that short codes should probably ...
0
votes
1answer
42 views

Shortcode to get featured image of specific id post

So I'm trying to create a shortcode to get specific id and its featured image to display it in a specific page. I want to use shortcode to make it easier for the user to add any post in this page. ...
0
votes
0answers
34 views

Modify shortcode to work with custom taxonomies and slugs

I am using this code which works fine with posts but I am looking to modify it so that the user can specify in the shortcode: custom post type name taxonomy name slug of taxonomy category For some ...
0
votes
0answers
22 views

Replacing Gallery Shortcode with Foundation's Clearing

Using wordpress 4.1 and Foundation 5, and attempting to replace the stock gallery shortcode with foundation's clearing. In debugging mode, I get a notice of: Strict Standards: ...
3
votes
1answer
66 views

Insert Images at Master Uniform Height

I'm trying to figure out a way to insert images from the media library into the post editor at a uniform height... but by selecting one option. For example, I set a height like "300" somewhere (like ...
0
votes
1answer
237 views

Catchable fatal error: Object of class stdClass could not be converted to string

I am trying to get the slug of a custom taxonomy for the current post that this shortcode is embedded in if the user doesn't define the slug he wants explicitly in the shortcode. function ...
0
votes
2answers
27 views

Shortcodes Keep Wrapping in <p></p>

I've been ripping my hair out for hours and now I'm almost bald! :p Any time I try to insert any shortcode into the visual editor (on its own line), it wraps them in <p></p> tags. This ...
0
votes
1answer
20 views

Shortcode not getting replaced

I used this to obtain my post: $the_slug = 'kontakt'; $args=array( 'name' => $the_slug, 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' ...
0
votes
1answer
27 views

Shortcodes won't work on live environment

I am currently developing a plugin that uses shortcodes. On my localhost everything works fine just using the shortcode, for example: [bbit bandname="Lady Gaga"] This shows a list of ...
0
votes
0answers
58 views

Get Current CPT taxonomy category in shortcode

I am calling my shortcode like this which works fine but I would like to avoid defining the slug, and instead picking it up automatically from the current custom post type that the shortcode resides ...
0
votes
1answer
24 views

Cant fix this Warning: Invalid argument supplied for foreach() in [closed]

I dont know what i have doing wrong. everything work fine. but i receive a warning in page Warning: Invalid argument supplied for foreach() in /public_html/wp/xtheme/wp content/themes/tab.php on line ...
0
votes
0answers
9 views

Shortcode displaying content at top of post [duplicate]

I've got a simple little shortcode plugin which should return the contents of a php file via object buffering. The code is an email form which was supplied by a third party. Here's take one: ...
0
votes
1answer
34 views

Automating the process of shortcode generation in a plugin - how is it done?

Automatic short code generation is a technique that I see many plugin authors use but unfortunately, I have yet to come across a tutorial that details this subject so I am hoping that someone in this ...
0
votes
0answers
21 views

How to display the comments_template with a shortcode and only on that location (remove from default location)?

How can I mimic the code below in order to display the comments list (comments_template) with a shortcode? add_shortcode( 'wpse_comment_form', function( $atts = array(), $content = '' ) { if( ...
0
votes
1answer
18 views

find shortcode inside content of post

I've a post with a video, contained inside the content. So, the content of my post is like: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur aliquam quam sed imperdiet viverra. In ...
0
votes
2answers
56 views

Is shortcode_unautop() broken?

shortcode_unautop() in /wp-includes/formatting.php is supposed to find shortcodes in a block of text and remove wrapping paragraph tags from them. I've been having issues with paragraph tags making ...
0
votes
1answer
78 views

Modify shortcode to work with custom post types

I have this shortcode which works fine with posts but I need to modify it to take arguments for custom post type and custom taxonomy. <?php // [blog_posts] function ...
0
votes
1answer
28 views

Does registering multiple shortcodes impact performance?

There are a range of plugins that register multiple shortcodes, sometimes up to 30. What are the performance implications of having multiple shortcodes registered? I would assume that having a huge ...