WordPress.org

Ready to get started?Download WordPress

Forums

prettyPhoto Media
Doesnt work...unless! (1 post)

  1. www.n1bar.com
    Member
    Posted 2 years ago #

    Hiya, before prettyphoto I was using shadowbox.

    However, I installed prettyphoto and it doesnt work, so i googled around and found the following in a post.

    add_filter('the_content', 'addprettyPhotorel_replace', 12);
    add_filter('get_comment_text', 'addprettyPhotorel_replace');
    function addprettyPhotorel_replace ($content)
    {   global $post;
    	$pattern = "/<a(.*?)href=('|\")([^>]*).(bmp|gif|jpeg|jpg|png|avi|mov|mp4|m4v)('|\")(.*?)>(.*?)<\/a>/i";
        $replacement = '<a$1href=$2$3.$4$5 rel="prettyPhoto['.$post->ID.']"$6>$7</a>';
        $content = preg_replace($pattern, $replacement, $content);
        return $content;

    I added the above code to my theme's functions.php and it is now working, why is this?

    Do i really need to add that code to my theme's functions.php?

    http://wordpress.org/extend/plugins/prettyphoto-media/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic