0
votes
1answer
76 views

Passing postid of Testimonial Custom Post in Shortcode Parameter

I am trying to create Testimonial custom post and display using shortcode function create_post_type() { register_post_type( 'testimonials',//new post type array( ...
0
votes
1answer
28 views

How to get my [shortcode] rendered on the home page, other pages are fine

I'm using a child theme of Pixlex. The theme has a options panel to let me choose wether I want 2 or 3 columns on the home page and if those columns are to be filled with a post or page. I have one ...
0
votes
1answer
36 views

TinyMCE strips content while pasting. Possibly a bug

I have a shortcode that has a 'style' attribute for a theme that I'm creating, which looks like this: [shortcode_name type="normal" style="fixed"] Now if I paste this in the TinyMCE editor, I get ...
1
vote
2answers
177 views

Generate Shortcodes by Taxonomy

Check this code: function slide_group() { register_taxonomy('Group', 'slides', array( 'hierarchical' => true /*visualizza come le categorie*/, 'label' => ...
0
votes
0answers
129 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 ...
1
vote
2answers
331 views

Place the page title into the short code

I have created a short code called [contianer-narrow][/container-narrow] which wraps your content in a twitter bootstrap class: .container-narrow the issue is that the page title is not included. is ...
0
votes
1answer
62 views

How to use shortcode inside of shortcode in theme

I am trying to place a shortcode inside another shortcode within a page template, however the various attempts I've made seem to not do anything. Here's how my code looks now - <?php echo ...
2
votes
2answers
121 views

What is wrong with this code I have to make a blockquote shortcode

I have a shortcode for a blockquote [blockquote]this is the quote[/blockquote] ... this is the code. function shortcode_shortcodetest( $atts, $content = null ) { $return = '<div ...
28
votes
4answers
5k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
1
vote
2answers
547 views

wp_nonce_field displaying twice

I have wp_nonce_field in my code but it's creating two instances to the html code for some reason, one where I'd expect it and another at the start of the entry. Is this correct or am I doing ...
3
votes
4answers
652 views

Run shortcode before filters

My users post snippets code in comments. I created a shortcode for this : function post_codigo($atts,$content=""){ return '<code>'.$content.'</code>'; } ...
0
votes
2answers
845 views

do_shortcode() in twentyeleven theme

I observed a difference between twentyten and twentyeleven themes. Let me explain with an example: example.com/category/health-beauty/ finds one post containing just a shortcode. If I use twentyten, ...
2
votes
1answer
1k views

Why does my short code get executed before other content?

I have the following text in a page. As you can see my shortcode is right at the bottom but somehow when the code runs, the out put of my shortcode is inserted at the top of the page instead of ...
0
votes
1answer
402 views

Extract all shortcode data from post into loop variables?

My client wants to have several pages in which he can edit small, separate parts of a Wordpress page. For example, there is a callout box in the upper left corner. There is also a small piece of ...
0
votes
1answer
243 views

Multiple Content Shortcodes

I was trying to create a shortcode for a multiple tabs panel. The user can set the number of tabs, the titles and the content for each. It would be something like : [tabs number='4'] [tab ...
0
votes
1answer
86 views

Wordpress Shortcodes - Optional Styles

i'm creating some custom shortcodes for my wordpress theme. Shortcodes are by nature optional on pages/posts, but may contain css, js or other files. My question is, how can i enqueue css styles ONLY ...
3
votes
1answer
716 views

do_shortcode() doesn't do shortcodes ;)

Imagine this basic shortcode in your functions.php file: function div_shortcode( $atts ) { return '<div class="div"></div>'; } add_shortcode('div', 'div_shortcode'); So every [div] ...
0
votes
1answer
343 views

Hide/disable sidebar using shortcode?

The question is pretty simple, but it's complex in fact. I have implemented custom sidebars for each post/page function in my blog. It looks like: <div id="<?php echo ...
0
votes
1answer
796 views

How to provide support for [gallery] shortcode?

I'm developing a new custom theme - and noticed that if a post contains the shortcode [gallery] it gets ignored (edit: I mean that the HTML delivered to the browser does not include [gallery], nor ...