diff --git a/library/bones.php b/library/bones.php index 0c9915425..a1e3ad578 100644 --- a/library/bones.php +++ b/library/bones.php @@ -209,6 +209,15 @@ function page_navi($before = '', $after = '') { } echo ''.$after.""; } + +// remove the p from around imgs (http://css-tricks.com/snippets/wordpress/remove-paragraph-tags-from-around-images/) +function filter_ptags_on_images($content){ + return preg_replace('/

\s*()?\s*()\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content); +} + +add_filter('the_content', 'filter_ptags_on_images'); + + ?> \ No newline at end of file