Moin zusammen,
ich bin noch immer auf dem "Seitennavigations-TRip" und bin hier auf diese Lösung gestoßen:
Für die functions.php ...
PHP
function wpe_highest_ancestor(){ global $post; $page_ancestors = end($post->ancestors); if(!empty($page_ancestors)){ $child_of = $page_ancestors; }else{ $child_of = $post->ID; } return $child_of; }
und für die Sidebar ...
PHP
<ul class="sidebar"> <?php $child_of = wpe_highest_ancestor(); wp_list_pages('child_of='.$child_of.'&title_li=<h5>'.esc_attr(get_the_title($child_of)).'</h5>'); ?> </ul>
Ist das eine Lösung, die generell einsetzbar ist bzw. in dieser Konstellation WP 3.2 + Twenty Eleven + Child-Theme auch funktioniert?
Den Code für die functions.php kann ich an deren Ende einfügen?
Und wo muss/kann der Code für die Sidebar, die so aussieht ...
PHP
<?php
/**
* The Sidebar containing the main widget area.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
$options = twentyeleven_get_theme_options();
$current_layout = $options['theme_layout'];
if ( 'content' != $current_layout ) :
?>
<div id="secondary" class="widget-area" role="complementary">
<?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
<aside id="archives" class="widget">
<h3 class="widget-title"><?php _e( 'Archives', 'twentyeleven' ); ?></h3>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
</aside>
<aside id="meta" class="widget">
<h3 class="widget-title"><?php _e( 'Meta', 'twentyeleven' ); ?></h3>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</aside>
<?php endif; // end sidebar widget area ?>
</div><!-- #secondary .widget-area -->
<?php endif; ?>
Alles anzeigen
... eingefügt werden?
Gruß+Dank