Posted By

jonahcoyote on 03/04/11


Tagged

sidebar pods


Versions (?)

Pods sidebars in WP Template


 / Published in: PHP
 

This code loads the sidebars pod, determines if the current page matches any of the selected pages for the sidebar record and loads the Pod template to use for each record.

  1. <?php
  2. global $wp_query;
  3. $current_page = $wp_query->post->ID;
  4. $where = "pages.id LIKE '". $current_page . "'";
  5. $Record = new Pod('sidebars');
  6. $Record->findRecords('weight ASC', -1, $where);
  7. ?>
  8. <ul class="xoxo">
  9. <?php echo $Record->showTemplate('sidebars_list'); ?>
  10. </ul>

Report this snippet  

You need to login to post a comment.