• Hello,

    Ok have a question did some research and got it to work so I can put spans in my li’s which work great but in the span I have a data-hover tag and inside it I want to put the title of the page but cant figure out how.

    As well it shows all the pages when I just want to show the childs of the parent which I have done before but when changing the echo $pages to echo$children it works and shows all the children but then removes my span info.

    Can anyone help heres the code…

    <?php
      				if($post->post_parent)
      					$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      				else
      					$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      				if ($children) { ?>
      					<ul class="cl-effect-2" id="cl-effect-2">
      						<?php
    	$pages = wp_list_pages('echo=0&title_li=');
    	$pages = str_replace('">', '"><span data-hover="PAGETITLEHERE">', $pages);
    	$pages = str_replace('<span data-hover="PAGETITLEHERE"><a', '<a', $pages);
    	$pages = str_replace('</a>', '</span></a>', $pages);
    	echo $pages;
    ?>
      					</ul>
      			<?php } ?>

    Thank you,

    Mike

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘wp_list_pages, Child Pages and Editing the lists’ is closed to new replies.