Support » Plugins » [Plugin: PostLists] How to remove p tags around my list ?

  • Hi,

    This is a wonderful plugin, I only have a little problem :

    I created a list (let’s call it “mylist”) with a div opening tag before the first entry and a div closing tag after the last entry. The problem is when i use my list in a page like this :

    My text before list
    
    [mylist]
    
    My text after list

    WordPress will automatically wrap my list (and so my div) in a paragraph.

    My site won’t validate XHTML 1.0 and I really need it to… Can anyone help please ?

    http://wordpress.org/extend/plugins/postlists/

Viewing 1 replies (of 1 total)
  • Thread Starter ircf

    (@ircf)

    As this is a WP more general issue, i solved it using a filter on the_content in functions.php :

    function custom_fix_paragraph($content){
    	$content = str_replace ('<p><div','<div',$content);
    	$content = str_replace ('</div></p>','</div>',$content);
    	return $content;
    }
    add_filter('the_content', 'custom_fix_paragraph');

    For this to work with postlists, i had to remove the author comment (sorry), because it was added between the p and the div opening tags.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: PostLists] How to remove p tags around my list ?’ is closed to new replies.