• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
Foster Solutions (FSI)

Foster Solutions (FSI)

The Solution is in the Process

  • Home
  • What We Do
    • Websites / Hosting
      • Author’s Sites
      • Boutique Websites
      • Corporate Websites
      • Open Source CMS
      • Quick and Dirty Websites
    • SQL Databases / VBA Automation
    • GIS / Market Research
    • Government/Planning
  • Case Studies
    • Databases/Automation Case Studies
    • GIS/Market Research Case Studies
    • Local Government Case Studies
    • FSI – crosspollination – examples
  • Clients
  • Articles
  • Contact Us

listing parent-child pages in sidebar

Here is the code to put into the sidebar that will list, if the page or its parent has children.

post_parent) {
// there is a parent, so
$sTitle = get_the_title($post->post_parent);
$theLink = get_permalink($post->post_parent);
$children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->post_parent.'&echo=0');

} else {
$sTitle = get_the_title($post->ID);
$theLink = get_permalink($post->ID);
$children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->ID.'&echo=0');
}

if ($children) {
?>


Ready to get started?

Client Survey

Please take this survey if you are interested in a new or modified website. We will assess and get back with you as soon as possible.


Finding Solutions

We work with you to make things faster, easier and better.

Sites

  • Home
  • Blog
  • About
  • Features
  • Contact
  • Marketing

Features

  • Home
  • Blog
  • About
  • Features
  • Contact
  • Marketing

Support

  • Home
  • Blog
  • About
  • Features
  • Contact
  • Marketing

Copyright © 2022 · Foster Solutions (FSI) · All Rights Reserved

Back to top