Title: robertlove's Replies | WordPress.org

---

# robertlove

  [  ](https://wordpress.org/support/users/robertlove/)

 *   [Profile](https://wordpress.org/support/users/robertlove/)
 *   [Topics Started](https://wordpress.org/support/users/robertlove/topics/)
 *   [Replies Created](https://wordpress.org/support/users/robertlove/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/robertlove/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/robertlove/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/robertlove/engagements/)
 *   [Favorites](https://wordpress.org/support/users/robertlove/favorites/)

 Search replies:

## Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to show page children links ONLY when viewing parent](https://wordpress.org/support/topic/how-to-show-page-children-links-only-when-viewing-parent/)
 *  [robertlove](https://wordpress.org/support/users/robertlove/)
 * (@robertlove)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/how-to-show-page-children-links-only-when-viewing-parent/#post-492524)
 * Slight correction to last post!
 * You don’t need to `get_the_ID` in the loop, and you should check if `$page_children`
   is empty, not an array. So, with that said:
 *     ```
       <?php
       $page_children = get_page_children(get_the_ID(), '');
       if (!empty($page_children)) {
           echo '<ul>';
           foreach ($page_children as $child) {
               echo '<li><a href=\"' . $child->guid . '\">' . $child->post_title . '</a></li>';
           }
           echo '</ul>';
       }
       ?>
       ```
   
 *   Forum: [Your WordPress](https://wordpress.org/support/forum/your-wordpress/)
   
   In reply to: [review please](https://wordpress.org/support/topic/review-please-1-3/)
 *  [robertlove](https://wordpress.org/support/users/robertlove/)
 * (@robertlove)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/review-please-1-3/#post-524835)
 * WTF also. You suck goodman48.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to show page children links ONLY when viewing parent](https://wordpress.org/support/topic/how-to-show-page-children-links-only-when-viewing-parent/)
 *  [robertlove](https://wordpress.org/support/users/robertlove/)
 * (@robertlove)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/how-to-show-page-children-links-only-when-viewing-parent/#post-492522)
 * Yes.
 * In your Page template file (page.php), get the ID of the parent page (this code
   must be in the loop):
 * `<?php $page_id = get_the_ID(); ?>`
 * Then, wherever you want to output the list of links to child pages:
 *     ```
       <?php
       $page_children = get_page_children($page_id, '');
       if (is_array($page_children)) {
           echo '<ul>';
           foreach ($page_children as $child) {
               echo '<li><a href="' . $child->guid . '">' . $child->post_title . '</a></li>';
           }
           echo '</ul>';
       }
       ?>
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to assign the_author_description to variable](https://wordpress.org/support/topic/how-to-assign-the_author_description-to-variable/)
 *  Thread Starter [robertlove](https://wordpress.org/support/users/robertlove/)
 * (@robertlove)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/how-to-assign-the_author_description-to-variable/#post-526088)
 * In the loop:
 * `<?php $author_id = get_the_author_ID(); ?>`
 * Then, wherever you want to output:
 *     ```
       <?php $userdata = get_userdata($author_id); ?>
       <?php if ($userdata->description != '') { ?>
       <h2>About the Author</h2>
       <p><?php _e($userdata->description); ?></p>
       <?php } ?>
       ```
   
 * Thanks for the heads up on get_the_author_ID() Ei Sabai. Who needs the experts
   when I have you sitting in the next office 🙂

Viewing 4 replies - 1 through 4 (of 4 total)