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

Strip shortcode from excerpt

I have this challenge, that i've found out that i'm not the only one in the WEB with the same issue, nevertheless, there are no solutions yet. I'm trying to remove shortcodes from my custom post ...
2
votes
1answer
75 views

How extend shortcode default values for a plugin?

I recognize this would be better suited for the plugin's official support thread, but the developer doesn't appear to read the forums. I'm using the Standout CSS3 Buttons plugin to add buttons via ...
0
votes
1answer
43 views

Shortcodes: Return different based on atts

I have the following shortcode for pullquotes: //Pullquote shortcode function pullQuotes($atts, $content = null) { extract(shortcode_atts(array( "author" => '' ), $atts)); return ...
0
votes
1answer
24 views

Problem code and show comments

I use this code in shortcode for show posts : <?php while ($wp_query->have_posts()) : $wp_query->the_post(); $imagen = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), ...
0
votes
1answer
57 views

Creating a shortcode in a plugin that includes JS

I use a lot of embedded tweets on my site. The script always gets stripped out. I added Twitter's code to my theme, but it doesn't work with infinite scroll. So I'd like to make a shortcode that will ...
0
votes
1answer
197 views

Why is my str_replace not working on short code submitted by front-end?

I've built a front-end post submission form that allows a user to include a shortcode provided by SoundCloud. SoundCloud shortcodes generally look like this: [soundcloud ...
1
vote
1answer
210 views

Are .MP3 files with capital letter extensions allowed in [audio] shortcode?

In WordPress 3.6, using the new [audio] shortcode, I can add a player for an .mp3 file like this: [audio src="http://example.com/audio_files/test.mp3"] However, if the .mp3 file has capital letters ...
0
votes
2answers
103 views

Wrap php in shortcode

I'm using a plugin that will display content based on user location, and I'm trying to add it to a facebook widget code. The plugin is using a shortcode to wrap content that will be displayed, and ...
0
votes
0answers
23 views

Button shortcode with two actions

I have a shortcode that handles url parameters and returns html form button to send user to info page. But now I need to include additional action that would run allow.php script when button is ...
0
votes
1answer
136 views

How to Generate html tags using shortcodes?

I am using a widget and adding this: <div id="testimonials"><h4>[acf field="testimonial" ] <strong>[acf field="name" ]</strong></h4> <h4>[acf ...
0
votes
0answers
122 views

Wordpess frontend posting -> Featured image

I'm currently making a custom Wordpress theme with custom templates for users to keep them 100% front-end. Now i am creating a frontend posting template but i'm stuck, i can't find a method to get ...
0
votes
1answer
1k views

How to add meta slider lite or other slider to main page header in pinboard theme

Slider is created using Meta Slider Lite v2.2.1. Meta Slider shows it usage as Shortcode [metaslider id=449] Template Include <?php echo do_shortcode("[metaslider id=449]"); ?> Pinboard ...
0
votes
3answers
71 views

return unformatted content in encosing shortcode

I've written a little shortcode, following basic instructions on Wordpress Codex: function myshortcode( $atts, $content = null ) { extract( shortcode_atts( array( ..., ), $atts ) ); ...
0
votes
0answers
178 views

Shortcode not working in custom post types

I have created a shortcode and placed it in my functions.php and registered it with: add_shortcode('featured-attribution', 'gteh_author_shortcode'); It works fine on posts and pages. I created a ...
0
votes
0answers
111 views

Passing a location-dependent array via wp_localize_script within a shortcode

I have created a shortcode that is intended to be inserted into custom field of a music custom post type. The shortcode is coverted into an audio playlist using the jplayer jquery plugin (and it's ...
0
votes
1answer
45 views

What is the best way to include a template file within a shortcode?

I'm writing a shortcode for a child-theme. I want to load a php template file to generate my HTML and then output this HTML in a string to return this string. But I don't know the best way to do ...
0
votes
1answer
156 views

What is the difference between Null vs Empty (Zero Length) string?

In a shortcode context, is there any difference here? array( 'slideshow' => '', ), and array( 'slideshow' => NULL, ), Is there a best practice for that?
1
vote
2answers
324 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 ...
0
votes
1answer
520 views

Loading shortcode with ajax

I'm trying to load a slideshow if the browser is a certain screen size - i.e. I don't want the slideshow to load on smaller, mobile screens. The slideshow plugin provides a shortcode: <?php echo ...
0
votes
1answer
41 views

Where to place PHP for shortcodes

My custom plugin is broken into two parts: a frontend.php and admin.php for loading code conditionally. Here is a rough outline of the code: <?php /* My plugin info here */ if (is_admin()) { ...
0
votes
0answers
28 views

How to use nextpage shortcode in the php loop?

At the single.php I want to auto paging every 5 images at the content loop with the shortcode. How to use the shortcode in php loop Or a similar way for that?? What can I do for?
0
votes
1answer
139 views

Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script

Short version: I'm able to get a PHP variable into a JS file using wp_localize_script. On JS file i'm able to echo the variable using console.log, but I cannot get it echo into the jQuery plugin's ...
0
votes
1answer
143 views

Flipping Book PHP Code? Any experience?

Hi there guys quick question, using FlippingBook and calling a gallery within a page or post is with something like this: [book id='1' /] but I want to call the gallery directly from my code, so is ...
0
votes
1answer
189 views

Displaying audio player as preview in audio post in WP3.6

I'm testing the new Wordpress 3.6 Release Candidate 2 and it's [audio] shortcode and there is something I can't figure out. The post contains the following content: [audio ...
3
votes
2answers
472 views

How to add stylesheets only to pages with specific shortcode?

I'm running a function on pages where the shortcode [make-me-a-map] is used. It enqueues javascript to the page and makes a map. That part works fine (woot!) but I'm having trouble with adding the ...
0
votes
2answers
72 views

Shortcode or placeholder for theme options page?

I'm writing a theme options page that provides a space for the user to enter code for social buttons e.g. <a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php ...
0
votes
1answer
227 views

Pass a comma separated shortcode attribute to a function

I've been trying to create a shortcode for the Category Ajax Chain Selects plugin so that I can display the chain selects within a chosen post/page easily, but for now I've only been able to hardcode ...
0
votes
1answer
2k views

Adding my own custom woocommerce shortcode to child theme, how?

So I bought a theme at themeforest.com that has some custom templates to use with the Woocommerce plugin. I made a child theme so I don't have to edit anything in this original theme. What I was able ...
0
votes
3answers
66 views

Is there any way to inject text onto pages?

I run a network of sites that get updated constantly, and the content they cover is updated frequently itself. So on each page we have a "updated for [text we want injected]" Is there a way to edit ...
0
votes
1answer
275 views

contact form 7 :create shortcode usable in email message

i have this (test ) function that adds a redirection bouton function bouton($atts, $content = null) { extract(shortcode_atts(array( 'lien' => '#', 'couleur' ...
0
votes
1answer
1k views

Registration Form Shortcode

Is There any way to create a shortcode for registration form using <?php do_action('register_form'); ?>
0
votes
1answer
69 views

How to show custom taxonomy child posts through shortcode in WordPress

My question: I have custom taxonomy in WP named Videos and childs of this taxonomy named music-videos and game-videos. In my WP theme this is shortcode which shows ALL video posts from main taxonomy ...
0
votes
0answers
19 views

How to search a target shortcode in posts

I want to search a target shortcode and display the shortcode in my theme. Here's my idea I have shortcode [soundcloud url="XXXXXXXXXXXXXX(dynamic)" params="" width=" 100%" height="166" ...
2
votes
2answers
83 views

How to handle valueless attributes in shortcodes?

Some HTML elements accept valueless attributes such as <input disabled /> or <video autoplay /> How do I handle this case with shortcodes where I want to disable autoplay by default (= ...
0
votes
1answer
139 views

How to parse this shortcode?

I have a shortcode like this [soundcloud url="http://api.soundcloud.com/tracks/67658191" params="" width=" 100%" height="166" iframe="true" /] How can I get the content of the URL part or extract the ...
0
votes
1answer
97 views

Could use some help with Shortcodes

So I am starting with shortcodes and this is my first time trying to make one, I am using it to make css/js tabs for information and basing off code I got from themeforest.. So I will do the best to ...
0
votes
1answer
22 views

Need to change contact email depending where user is from

I work for a company that has multiple sites, but one of them has all of the content. I am using Contact-Form-7 for the little contact forms at the bottom of the page, but what I need is for them to ...
0
votes
1answer
109 views

Calling widget using shortcode

I am using shortcode to call a widget. All is working fine but I want to pass some $instance(parameters) to the_widget. I am using $content to pass paramets to the_widget but I dont see any chnages ...
2
votes
1answer
162 views

how to show database content in wordpress post

I'm a beginner for WordPress. I have a database app written in PHP and MySQL and I need to convert it to WordPress and also I what to post the database rows info by shortcode were id="x" like: ...
1
vote
1answer
31 views

How do I write this shortcode? [closed]

I have this shortcode, I would like to write in a better and clean way: function webhosting_products_shortcode( $atts, $content = null) { $content='<h2 class="heading_blue">Eburnie Hosting ...
2
votes
1answer
270 views

How do i get (unique) page name?

Like from the page of http://localhost/wordpress/about_us/ how do i get only the "about_us" ? Thanks
2
votes
0answers
172 views

Wp_localize_script from Shortcode [closed]

I've been trying for hours and tried several answers from here and Google but still no luck.. need help. I am making a shortcode (slider) and trying to execute a javascript file (for the slider's ...
0
votes
0answers
54 views

shortcode problem

Can someone tell me what is wrong this woocommerce shortcode? add_shortcode( 'showdecimal', 'showdecimal_func'); function showdecimal_func($atts){     extract( shortcode_atts( array(     'price' ...
0
votes
0answers
91 views

Allow BBPress Authors/Participants to create shortcodes/upload images to topic reply

I have this website with over 100+ members using bbpress, I've set all those members as Wordpress Authors so they can see the 'Add Media' Button and as 'Participants' so they can create topics and ...
0
votes
1answer
205 views

load plugin with ajax [duplicate]

is there a way to load plugin with ajax? I want to load Quick Chat plugin which supports initializing with PHP and Shortcode [quick-chat height="400" room="default" userlist="1" ...
0
votes
1answer
71 views

Overriding Attributes values in Shortcode Plugins

I have made some shortcode plugins according to my need. But this time I am getting a strange problem. My attributes in the shortcode are not getting the values written in the shortcode while ...
0
votes
1answer
74 views

Nested loop called with shortcode duplicating the content above the main loop

I'm trying to use a shortcode to call one post from a custom post type and display it inside another page's content. (Basically, we have a custom post type called 'testimonials' and we want to display ...
0
votes
1answer
293 views

Add number in increment of one to DIV ID

I'm using a shortcode to display a custom post type. The shortcode contains an attribute to display only posts of a specific category within the custom post type e.g. [faq category="travel"] For each ...
1
vote
1answer
291 views

Add category attribute to custom shortcode

I have created a custom post type called "faq". The custom post type uses categories. I have created a shortcode [faq] that displays all the faq posts. What I would like to do is add an attribute to ...
1
vote
1answer
65 views

Display gallery on bottom after content

How to execute the gallery shortcode after any other content no matter where the shortcode is in the post HTML? Thanks.