[Plugin: prettyPhoto Media] Doesnt work…unless!
-
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?
https://www.ads-software.com/extend/plugins/prettyphoto-media/
- The topic ‘[Plugin: prettyPhoto Media] Doesnt work…unless!’ is closed to new replies.