Pods sidebars in WP Template


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

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.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.