luth31815
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Warning: Missing argument 1 for get_top_ancestor()I believe this is the code that has the issue.
?>
<div id=”sidebar” class=”alignleft”>
<div id=”sidebarTop”>
</div><!–/sidebarTop–><div id=”sidebarMid” class=”content”>
<?php
$top_ancestor = get_top_ancestor();
$children = wp_list_pages(‘title_li=&child_of=’.$post->ID.’&echo=0&sort_column=menu_order&depth=1′);
$siblings = wp_list_pages(‘title_li=&child_of=’.$post->post_parent.’&echo=0&sort_column=menu_order&depth=1′);
$practice_area = wp_list_pages(‘title_li=&child_of=8&echo=0&sort_column=menu_order&depth=1’);
?><?php
if ( is_post_type_archive() && is_active_sidebar(‘blog-sidebar’) ):
dynamic_sidebar( ‘blog-sidebar’ );
endif;// if it’s blog, single, category or archive… and the blog-sidebar widget is active, show
if (
(is_home() && is_active_sidebar(‘blog-sidebar’)) or
(is_single() && is_active_sidebar(‘blog-sidebar’)) or
(is_category() && is_active_sidebar(‘blog-sidebar’)) or
(is_archive() && is_active_sidebar(‘blog-sidebar’)) ):
dynamic_sidebar( ‘blog-sidebar’ );
else:
// ********** ?>
<p class=”sideTitle”>Practice Areas<p>
<?php
if ($children) { ?>-
<?php echo $children; ?>
<?php }
else {
// if parent is practice area, show siblings
if($top_ancestor == 8): ?>-
<?php echo $siblings; ?>
<?php
// if not, show practice area nav
else: ?>-
<?php echo $practice_area; ?>
<?php
endif;
}
// **********
endif;
?></div><!–/sideMid–>
<div id=”sidebarBtm”>
</div><!–sideBtm–>
</div><!–/sidebar–>