Gist shortcode is not working

Gist tags and oembed handling is specific to WordPress.com, and doesn’t come bundled with standard WordPress from wordpress.org You will need to acquire a plugin to register gists as an oembed provider, or add embed tags. There are plenty of plugins that do this available, I use this one. If you’d like to write your … Read more

How do I turn a shortcode into PHP code?

In general, inserting and executing shortcodes directly into templates files is not good idea and it is not what shortcodes are intented for. Instead, you should use the shortcode callback just like any other PHP function or template tag. For example, let’s imaging this shortcode: add_shortcode(‘someshortocode’, ‘someshortocode_callback’); function someshortocode_callback( $atts = array(), $content = null … Read more

What is a short code?

“Shortcode” is a user friendly way of inserting various WordPress plugins/scripts into a page without having to know a lot of fancy HTML/JavaScript/PHP in order to make it happen. Take, for example, embedding an mp3 file into a post on a hosted WordPress site. Instead of having to setup the proper code for a flash … Read more

Help with shortcode in admin-ajax [closed]

How you are applying a filter is wrong. You need to bind a function to the filter, but you are providing a variable. function my_filter( $content ) { return $content . ‘My added code’; } add_filter( ‘the_content’, ‘my_filter’ ); You should add the code like this, this should work.

Using Shortcodes in WP-Menus in WP 3.1 (via nav_menu_objects)?

The problem is that do_shortcode() expects a string in it’s first parameters while wp_nav_menu_objects get’s passed an array of menu objects. Sou you’d have to write your own wrapper function to do_shortcode, something like this… function my_nav_menu_objects_shortcode_mangler($items) { foreach ($items as $item) { $item->classes = explode(‘ ‘, do_shortcode(implode(‘ ‘, (array)$item->classes))); } return $items; } may … Read more