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

How do I turn a shortcode into php?

I need to add a shortcode into one of the php files (replacing a search bar code that is hardcoded into the header php file). How do I add a shortcode to the header php file? This is the code that I ...
0
votes
1answer
26 views

Shortcode not working in widget

I created the following shortcode: function newsletter_signup_shortcode( $atts ) { $post_type = get_post_type(); // Attributes extract( shortcode_atts( array( 'location' => ...
0
votes
2answers
21 views

php in a shortcode

One of the major problems I have with a big site is the number of templates. So I figure I could call an optional footer within the page using a shortcode. function trainer_footer( ){ get_footer('...
0
votes
2answers
87 views

Formatting Shortcode to Display in Visual Mode

I was wondering if it's possible to convert this kind of shortcode: [card name="Muscle Band" set="XY" no="121" c="name"][/card] Into this in Visual Mode (in blue-colored text): Muscle Band XY ...
-1
votes
2answers
150 views

Previous/Next with the same category

I have this code to use with shortcode at my portfolio pages. Everything is working fine, but I need that next and previous get the same category. This is the code: add_shortcode( 'prev', '...
0
votes
1answer
105 views

PHP Shortcode - 500 error

I have been working on a shortcode with help from this article: http://code.tutsplus.com/tutorials/create-a-shortcode-to-list-posts-with-multiple-parameters--wp-32199. I have tried to do what the ...
0
votes
1answer
58 views

Use html tags in shortcode_atts, is it real?

can i use html tags in shortcode attributes? like this: function b_text( $atts, $content = null ) { extract( shortcode_atts( array( 'text' => '<div class="myClass">DOM</div>' ),...
0
votes
0answers
14 views

Show invoice in PDF based on user selection - wpcf7_posted_data [duplicate]

Here is my code and it's not working. function show_bill( $data ) { $data = do_shortcode( '[pdf-embedder url=http://xyxy.com/home/invoices/TCH6418086-2015Sep28_Oct04.pdf]' ); return $data; } ...
0
votes
1answer
102 views

call other shortcode in the email contactform7 send

Please advise how I can call other shortcode in the email contactform7 send. Here is my code: function show_bill( $wpcf7 ) { $wpcf7 .= do_shortcode('[pdf-embedder url=http://xyxy.com/home/...
0
votes
0answers
16 views

Call other shortcode on button click [duplicate]

How can I run other shortcode on click? Here is my code: add_action( 'wpcf7_before_send_mail', 'show_bill' ); function show_bill( $wpcf7 ) { $form = do_shortcode('[pdf-embedder url=http://...
0
votes
0answers
34 views

How can I call other shortcode in the form?

I am using the following code. It works fine, but the issue is my form gets replaced with the result of the shortcode. How can I call the shortcode without replacing the form? add_filter( '...
0
votes
2answers
52 views

Shortcode arguments to another shortcode

I am learning about shortcodes. I've made 2 shortcodes that makes an accordion with bootstrap. One shortode (accordionGroup) creates the body that contains one or more shortcodes to make the items and ...
0
votes
0answers
47 views

Shortcode Displaying Content Twice

I have written this shortcode in my functions.php, its taken from a plugin but its functioning as stand alone, because i have renamed functions and shortcode. This shortcode prints the content of wiki ...
0
votes
0answers
23 views

Portfolio does not appear in Mutilingual site - PolyLang

My theme has an inbuilt portfolio, as it's a portfolio specific site. I'm localizing the site, and have been using the Polylang plugin for subdirectory creation. I have added the shortcode (that the ...
0
votes
0answers
20 views

Attempting to add an imagemap/ content to Front Page — shows up only in meta description

I'm dealing with a nasty old theme for a friend that uses a huge slider as its homepage background image. I'd rather not scrap and recreate the site, as back in the day I put in a good amount of ...
1
vote
2answers
27 views

Freeze a shortcode in place?

Is there a way to "freeze" a shortcode in place so non-Administrators can't edit it? Let's say I have a page like this: [shortcode] Text of the page [other shortcode] Is there a way that non-...
0
votes
0answers
56 views

How to call metabox value in custom post type query shortcode?

I am trying to make a testimonial shortcode. That is why I registered a custom post type and now trying to call it using shortcode. I also create a custom metabox for testimonial client country input. ...
0
votes
1answer
212 views

How to create a shortcode for custom page template

I have a custom page template and I want it to display on specific pages. The only way I know to do this is to create a shortcode for this custom page template, so that I can use the custom page ...
0
votes
1answer
48 views

Metabox Keeps Stripping Parts of Shortcode

I am creating a custom metabox, and it will be filled with shortcode. The problem is, after I saved it, it keeps stripping / deleting the last part of the shortcode, like this: Suppose to be: [...
1
vote
3answers
71 views

Remove Shortcode […] from Blog Preview

When utilizing shortcode (plugin, etc.) near the top of the page, the plugin shortcode displays in the preview. Is there a way to hide text within brackets [text like this] from a preview on a recent ...
1
vote
3answers
80 views

Shortcode output is screwed up when arrow symbol “<” is present in content

I have a very simple shortcode to print some text using pre tags function term_shortcode( $atts, $content = null ) { return "<pre>" . htmlentities($content) . "</pre>"; } ...
0
votes
0answers
76 views

Inserting PHP code snippet via shortcode

I'm trying to insert a PHP snippet on a WordPress page using XYZ Insert PHP Code Snippet plugin. This is the code that I'm using but it's not working and I can't figure out what's wrong. I've tried ...
0
votes
1answer
85 views

Get post content from outside the loop with plugin shortcode usability

This is great for showing just the raw content... Get post content from outside the loop But i'd also like to apply shortcodes from various plugins to my content to affect the content. What would I ...
0
votes
3answers
57 views

Shortcode not showing anything

I am using this code, but nothing is being shown on the front page. It seems the shortcode is registered correctly though. function choose_ashtopbar() { ?><img src="/images/flag_globe2.png" ...
0
votes
0answers
18 views

Shortcode sort by category

I have created my own slideshow plugin. When a user adds a slide he/she can also add a category for that slide. I want by shortcode to sort by categorys sort of like [shortcode category="awesome"] ...
0
votes
1answer
61 views

Order Woocommerce Products by Latest Reviewed

In my Woocommerce site, I have: [recent_products per_page="16" columns="4"] which as the shortcode infers, orders products by the most recent. If I wanted to order my products by the ones latest ...
0
votes
0answers
27 views

custom widget plugin work but will not ouput html code on frontend

this custom widget plugin works but on the frontend if i input html codes in the form it will not show on frontend meaning on the frontend none of the html code will work nor show but the text will ...
0
votes
0answers
20 views

Take image from post content, which is image from shortcode slider

I have slider plugin which is added to a post with shortcode. I need to make the first slider image appear as post thumbnail on a home page of the site. First I check if the post has slider shortcode: ...
0
votes
0answers
27 views

Pinterest Pin it shortcode isn't working

function get_pin($atts) { $pinterestimage = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); return '<a href="http://pinterest.com/pin/create/button/?url=' . ...
0
votes
1answer
78 views

FontAwesome Shortcode isn't working properly

function addscFontAwesome($atts) { extract(shortcode_atts(array( 'type' => '', 'size' => '', 'rotate' => '', 'flip' => '', 'pull' => '', 'animated' => '',...
0
votes
0answers
21 views

How to sort by meta value, then by other meta value

I've been tasked with creating a 'fully automated' agenda for my client. The goal here is to create an agenda for a conference. The idea is that one shortcode will automatically populate the entire ...
0
votes
0answers
51 views

wp_query with shortcode do_shortcode out of while

I have a theme that uses an accordion that needs nested short codes. I'm trying to get it to work in my wp_query. [av_toggle_container initial='0' mode='accordion' sort=''] [av_toggle title='Toggle ...
0
votes
1answer
46 views

Wordpress plugin shortcodes not outputting anything

I'm in the process of creating a WordPress plugin that retrieves information from a Minecraft Server. I have the script to do this working fine as just a PHP script, however, when I try to convert ...
0
votes
2answers
95 views

How do I pass custom shortcode-extracted variables (taxonomy) into a query function for WordPress RoyalSlider?

Plugin in question: http://dimsemenov.com/plugins/royal-slider/wordpress/ Background: This is a great plugin, and it features a 'post' version where the slider pulls content from posts. However, the ...
0
votes
0answers
11 views

What Will Happen If I do This Hook-ing Pattern?

I am creating a custom hook inside a shortcode like this: do_action("my_custom_hook", $param_1, $param_2, $param_3); I then creating a file containing a class and hooks like the following: class ...
0
votes
1answer
54 views

Run PHP Results inside WP Shortcode

How would I put the below results into the WP Short code? PHP Results: <?php function endsWith($haystack, $needle) { // search forward starting from end minus needle length characters ...
0
votes
0answers
48 views

Conditions to run shortcode from plugin at theme

I´m new to WordPress developing and haven´t figured out, what is needed to run a shortcode from a plugin at the theme. The shortcode is registered at the plugin and the template code <?php ...
0
votes
0answers
50 views

Create custom shortcode inside short code

@toscho answered a similar question here: Shortcode return $content vs do_shortcode($content) There are other answers that are also close, but nothing has been helpful...hope someone here can help. ...
0
votes
1answer
54 views

Alternate text if shortcode returns no data

I'm using some plugins like beer list from Rescuethemes, and an event list, that use a shortcode to display a list of items. I put the shortcode into a Page, and it shows the data. If the shortcode ...
0
votes
0answers
62 views

How to use shortcode in Javascript?

I wrote a script that adds current user name to my button URL. To get current user, I use a plugin. When I use shortcode of plugin, [currentuser_username], then it displays the current user name. So I ...
1
vote
0answers
39 views

Adding a colorbutton in tinymce dialog with current api

I'm trying to add a colorbutton in a tinymce dialog box, which i was able to do with the help of using this stackoverflow question here: http://stackoverflow.com/questions/23511566/adding-a-...
0
votes
1answer
21 views

Hide some shortcodes on posts from back-end

I searched everywhere on the web and I didn't find something that could really help me. Here is my problem; I use a plugin that provides shortcodes to show a file in a page or a post. For each file I ...
-2
votes
1answer
55 views

How Do I create a shortcode to dispaly a go to top button on any page or post

I am creating a wordpress site, and on every page I would require go to top button. So I was thinking to get some shortcode to do this so that I can insert anywhere. Thanks
0
votes
2answers
57 views

What is the proper way to include Bootstrap when executing a shortcode

I am trying to include bootstrap only when the short-code function executes. It gets included but it affects the other tags of the theme. The only way I can get around this is including bootstrap ...
5
votes
1answer
124 views

Tinymce - How to hook before or after live shortcodes rendering?

When the edit post page loads in WordPress admin, I launch a js process which alters the TinyMCE editor’s contents. Recently I've come across the WordPress live shortcode previews which break my code,...
0
votes
2answers
81 views

How to make a conditional statement within $output in shortcodes.php?

I've got a shortcode that's got HTML in an $output field that's lovely. I just want to add one paragraph to it at the bottom that's conditional on this statement: <?php if ( get_post_meta( ...
0
votes
0answers
94 views

How to output a PHP file values by shortcode?

I'm trying to output the values of two custom fields created by ACF plugin in a custom post type. I actually need this to be displayed in a popup window. wordpress popup plugins don't support php code,...
0
votes
1answer
88 views

Insert shortcode between '<div>'

I would like to insert a shortcode in the code just after "$cb_post_views" so the shortcode appears on the same line if ( ( $cb_meta_onoff == 'on' ) || ( $cb_posts_on == true ) ) { $cb_byline ...
1
vote
0answers
30 views

Tinymce shortcodes within shortcode contents

I am using wp.mce.views.register to create a simple view for my shortcode in the tinymce editor, this works fine but i am looking for a way to have "nested" shortcodes e.g. [column_3] [info_box] ...
0
votes
1answer
161 views

Hook WP_Embed run_shortcode

I want to hook run_shortcode inside WP_Embed, but I can't figure out how to pass $tag argument to add_filter global $wp_embed; add_filter( '$wp_embed->run_shortcode' , 'my_run_shortcode' , 0); ...