Shortcode in AJAX popup
Adding the solution for posterity – I solved it by adding FB.XFBML.parse(); once the AJAX call returned succesfully. Hope this helps.
Adding the solution for posterity – I solved it by adding FB.XFBML.parse(); once the AJAX call returned succesfully. Hope this helps.
The WP global variable $pagename should be available for you, I have just tried with the same setup you specified. $pagename is defined in the file wp-includes/theme.php, inside the function get_page_template(), which is of course called before your page theme files are parsed, so it is available at any point inside your templates for pages. … Read more
Okay, there are two things going on. First, since you are running WordPress 3.6, you don’t need to run any other media player plugins. Deactivate Widgetkit and use the following shortcode to add your audio player: The reason you aren’t seeing the play button on your players is that your web server is not serving … Read more
First off, your shortcodes are not formatted correctly for WordPress. You need to have a tag for your shortcode and then define the attributes separately. Instead of [list-style=”one”][/list-style] it needs to be something like [list class=”one”][/list] The following code will add two shortcodes to your WordPress install. [list] and [li] // shortcode for the list … Read more
This is very challenging for generic case since shortcodes can be nested, can be self-closing or enclosing and so on. If you need to do this on limited and fixed set of specific shortcodes that would be easier. I would unregister their shortcode handlers and register custom handlers that call original ones and add necessary … Read more
I think I have figured out the problem, though I have yet to solve it. I am running the shortcode in a WP Types custom WYSIWYG field. The shortcode works perfectly everywhere else, including directly in my theme files and in the native WordPress content WYSIWYG, so it seems it is a bug in WP … Read more
You would need to use WordPress Conditional Tags to query if this page is the custom post type you are wanting to target and then if it is remove shortcode. Untested but you can try this: function remove_shortcodes( $content ) { if ( get_post_type() == ‘post-type-name’ ) { return strip_shortcodes( $content ); } else return … Read more
I thought about making this a plugin since so many people ask about it, but here’s what you can do. This is by far the most consistent option that I’ve found because it allows you to do virtually anything you want in menus and doesn’t require writing your own walker class. Install stag custom sidebars … Read more
wp_register_script() just adds an entry to an array, it doesn’t do anything resource intensive. See WP_Dependencies::add(). Registering scripts early helps to avoid collisions, so you should do that always on wp_loaded.
I would use the filter wp_audio_shortcode: /** * Filter the audio shortcode output. * * @since 3.6.0 * * @param string $html Audio shortcode HTML output. * @param array $atts Array of audio shortcode attributes. * @param string $audio Audio file. * @param int $post_id Post ID. * @param string $library Media library used for … Read more