Forums

wp_list_pages creates extra paragraph only on FIRST child (4 posts)

  1. llirik
    Member
    Posted 5 months ago #

    I'm using wp_list_pages and suddenly it has begun to add an extra <p></p> right after the very first list, and I can't figure out why. The code itself is super simple,
    <ul id="list_vehicles"><?php wp_list_pages('title_li=&child_of=714');?></ul>

    but on the first items, i keep getting the extra paragraph. Ive reduced template pages down to literally zero, and it seems to only go away when not using the

      I've even tried to output it all into an entire string using ob_start/clean and search for the <p></p> but for some reason that is skipping over it.

      Any ideas?

  2. llirik
    Member
    Posted 5 months ago #

    upon a bit more inspection, safari inspector is showing the <p></p>... but in the raw code, only a </p> pops up out of nowhere on the first one.

  3. llirik
    Member
    Posted 5 months ago #

    OKAY... after hours of going through this... I've fixed... but I have no idea if i'm breaking something else.

    I was able to get rid of the </p> that was being added by removing the \n in /wp-includes/post-template.php

    function start_lvl(&$output, $depth) {
    		$indent = str_repeat("\t", $depth);
    		//$output .= "\n$indent<ul class='children'>\n";
    		$output .= "$indent<ul class='children'>\n";
    	}

    i'm not sure though... is this a bug that needs to be filed or am i a random one time only case?

  4. llirik
    Member
    Posted 5 months ago #

    i'm finding the wordpress forums to be extremely unhelpful and unfriendly....

Reply

You must log in to post.

About this Topic