Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Assuming that your code is actually working - (is your markup actually getting filtered?) - this will fail, as thickbox has not been activated. You must manually inject it: </p> <p>As @Alexcp noted - you must register and enqueue the javascript and css manually (outside of the admin section). In addition to your preg_replace function, add the following to your template's <code>Functions.php</code>.</p> <pre><code>// register scripts if (! function_exists(thickbox_register){ function thickbox_register() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery','http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js'); wp_register_script( 'thickbox', 'path to thickbox'.thickbox.js, 'jquery'); } } add_action('init', 'thickbox_register'); //print the now registered scripts if (! function_exists(thickbox_enqueue){ function thickbox_enqueue() { wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'thickbox' ); } } add_action('wp_print_scripts', 'thickbox_enqueue'); // do the same for css if (! function_exists(thickbox_style_enqueue){ function thickbox_style_enqueue() { wp_register_style( 'thickbox', 'path to css'.thickbox.css ); wp_enqueue_style( 'thickbox' ); } } add_action('wp_print_styles', 'thickbox_style_enqueue'); </code></pre> <p>Note that paths can be obtained <a href="http://codex.wordpress.org/Function_Reference/bloginfo" rel="nofollow">several ways</a> - but something like <code>bloginfo('url');</code> should get you started.</p> <p>If you still have problems, use FireBug or something like it to ensure that <strong>thickbox is getting registered properly</strong> in the jquery object of the DOM.</p> <p>Hope that helps</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload