cwulff

Roots Config - Sidebar

Jul 31st, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.33 KB | None | 0 0
  1. /**
  2.  * Define which pages shouldn't have the sidebar
  3.  *
  4.  * See lib/sidebar.php for more details
  5.  */
  6. function roots_display_sidebar() {
  7.   $sidebar_config = new Roots_Sidebar(
  8.     /**
  9.      * Conditional tag checks (http://codex.wordpress.org/Conditional_Tags)
  10.      * Any of these conditional tags that return true won't show the sidebar
  11.      *
  12.      * To use a function that accepts arguments, use the following format:
  13.      *
  14.      * array('function_name', array('arg1', 'arg2'))
  15.      *
  16.      * The second element must be an array even if there's only 1 argument.
  17.      */
  18.     array(
  19.       'is_404',
  20.       'is_front_page',
  21.      
  22.       array( 'in_array',
  23.         array(
  24.           basename( roots_template_path() ),
  25.           array(
  26.             // your template files here...
  27.             'archive-seo_partner.php',
  28.             'single-seo_partner.php',
  29.             'archive-seo_resource.php',
  30.             'single-seo_resource.php',
  31.             'archive-seo_project.php',
  32.             'single-seo_project.php',
  33.           )
  34.         )
  35.       )
  36.     ),
  37.     /**
  38.      * Page template checks (via is_page_template())
  39.      * Any of these page templates that return true won't show the sidebar
  40.      */
  41.     array(
  42.       'template-custom.php',
  43.       'template-events.php'
  44.     )
  45.   );
  46.  
  47.   return $sidebar_config->display;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment