PHP snippet for Lawrence! 2


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <div class="sidebar" id="ip-sidebar">
  2. <h1><span>More</span> Investment Professionals</h1>
  3.  
  4. <?php $id_of_the_parent_page = 17; ?>
  5. <?php $pages = get_pages(); ?>
  6. <?php $allChildrenPages = & get_page_children( $id_of_the_parent_page, $pages ) ?>
  7. <?php for ($i=0; $i < count($allChildrenPages); $i++) { ?>
  8. <?php $thisChildPage = $allChildrenPages[$i]; $childId = $thisChildPage->ID; ?>
  9.  
  10. <?php $key="choose-invest-prof" ?>
  11. <?php $value= get_post_meta($post->ID, $key, true); ?>
  12.  
  13. <?php
  14. if ($value=="investment-professional"): {?>
  15.  
  16. <div class="item <?php $key="choose-invest-prof"; echo get_post_meta($thisChildPage->ID, $key, true); ?>">
  17. <div class="thumb">
  18. <div class="border">
  19. <?php echo $thisChildPage->post_content; ?>
  20. </div>
  21. </div>
  22. <div class="item-info">
  23. <h4><a href="<?php echo get_permalink($thisChildPage->ID); ?>"><?php echo $thisChildPage->post_title; ?></a></h4>
  24. <p><?php echo get_post_meta($childId, "job-description", true) ?></p>
  25. </div>
  26. <div class="clear"></div>
  27. </div>
  28. <?php endif ?>
  29.  
  30. <?php } ?>
  31. </div>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.