BakerMan

TEC Template Based Layout Control

Sep 14th, 2012
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. /**
  2.  * Assuming Events > Settings > Templates > Events Template is set to "Default
  3.  * Events Template" then you could add this code to your custom
  4.  * ecp-page-template.php - placing it just above the get_header() call.
  5.  *
  6.  * You would of course have to change the names of the template parts to actual
  7.  * templates within your theme. You could then have different layouts according
  8.  * to whether a month (grid) view or an upcoming events list is being requested.
  9.  */
  10. if (tribe_is_month()) {
  11.     get_template_part('custom-layout-for-grids');
  12.     return;
  13. }
  14. elseif (tribe_is_upcoming()) {
  15.     get_template_part('custom-layout-for-lists');
  16.     return;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment