'; } return $str; } } // prints out a list of the current page's children or siblings in a widget div function asfp_subpages_nav($args=null) { parse_str($args,$arg); // link_heading global $post; if (is_page() && !is_404() && !is_search() && !is_front_page()) { // If CHILD_OF is not NULL, then this page has a parent // Therefore, list siblings i.e. subpages of this page's parent if ($post->post_parent) $thelist = wp_list_pages('echo=0&title_li=&depth=2&sort_column=menu_order&child_of='.asfp_get_ancestor()); // If CHILD_OF is zero, this is a top level page, so list subpages only. else $thelist = wp_list_pages('echo=0&title_li=&depth=2&sort_column=menu_order&child_of='.$post->ID); if (!empty($thelist)): if ($post->post_parent) { $sectitle = get_the_title(asfp_get_ancestor()); $securl = get_permalink(asfp_get_ancestor()); } else { $sectitle = get_the_title($post->ID); $securl = get_permalink($post->ID); } ?>

'; echo $sectitle; if (isset($arg['link_heading'])) echo '' ?>

post_parent) { $ancestor = get_posts('post_type=page&include='.$post->post_parent); if ($ancestor[0]->post_parent) return $ancestor[0]->post_parent; else return $post->post_parent; } else return false; } /* * NOT TEMPLATE FUNCTIONS * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // Used by document types feature function asfp_doctypes_regex($text) { $types = get_option('asfp_doctypes_list'); $types = ereg_replace(',[:space:]*','|',$types); // add the class to links $text = eregi_replace('href=([\'|"][[:alnum:]|[:punct:]]*)\.('.$types.')([\'|"])','href=\\1.\\2\\3 class="link \\2"',$text); // remove the class from links followed directly by an image tag $text = ereg_replace('(]+)class="link [^"]+"([^>]*>)ID,'thumbnail','','url'); if (empty($postimg)) $postimg = $defaultimg; if (is_single() || is_page()) $fb_thumb = $postimg; else $fb_thumb = $defaultimg; // figure out excerpt/description global $post; setup_postdata($post); $description = get_bloginfo('description'); $excerpt = strip_tags(get_the_excerpt()); if (empty($excerpt)) $excerpt = $description; ?> "/>