I would like to add thickbox for the template which I develop to WordPress. At this time I’m trying with a clean template that have only header.php
, footer.php
,index.php
, and functions.php
.
I’ve included the <?php wp_head(); ?>
into header.php
and the <?php wp_footer(); ?>
into footer.php
.
I’ve included the wp_head
like this:
<?php
wp_enqueue_script('jquery');
wp_enqueue_script('thickbox');
wp_enqueue_style('thickbox');
wp_head();
?>
I’ve changed the gallery link classes to thickbox with this code in functions.php
<?php add_filter( 'wp_get_attachment_link', 'sant_prettyadd');
function sant_prettyadd ($content) {
$content = preg_replace("/<a/","<a class=\"thickbox[slides]\"",$content,1);
return $content;
}
?>
When I’m clicking on to a gallery image it should open with thickbox but it opens the imagefile only.