• I’m using the code below to insert navigation lists. The code filters out navigation lists on post types ‘ai1ec_event’. However, for those pages displaying a sidebar and not of post type ‘ai1ec_event’ and containing the calendar widget, when you hover over an event it displays the navigation list in the excerpt section of the event details. The link below demonstrates this behavior. Note that when clicking on any event in particular, the page that is displayed does not have a navigation list. Is this a bug?

    Example

    function an_navigation_list($content) {
    global $post;
    	$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&depth=1');
    	if ($children) {
    		$content = '<ul>'.  $children . '</ul><hr/>' . $content;
    		return $content;
    	}  elseif ($post->post_type != 'ai1ec_event'){
    		$content = '<ul>'.  $children . wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&depth=1&exclude=".$post->ID) . '</ul><hr/>'  . $content;
    		return $content;
    	} else {
    		return $content;
    	}
    }
    add_filter('the_content', 'an_navigation_list');
Viewing 1 replies (of 1 total)
  • Thread Starter Aori Nevo

    (@anevo)

    The following work-around requires that you edit the twenty-eleven theme file content-page.php. Add

    <?php global $post;
    	$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&depth=1');
    	if ($children) {
    		echo '<ul>'.  $children . '</ul><hr/>';
    	}  else {
    		echo '<ul>'.  $children . wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&depth=1&exclude=".$post->ID) . '</ul><hr/>';
    	}
    ?>

    after the line

    <div class="entry-content">

    This solution is not ideal, as changes will be overwritten whenever you upgrade your theme.

Viewing 1 replies (of 1 total)
  • The topic ‘Sidebar jQuery showing wp_list_pages in excerpt’ is closed to new replies.