Note that there are some explanatory texts on larger screens.

plurals
  1. POWordPress Roots theme get rid of sidebar from all Pages
    primarykey
    data
    text
    <p>My goal is to get rid of the sidebar on all Pages, but my website has Roots installed and so the page.php template just has this code:</p> <pre><code>&lt;?php get_template_part('templates/page', 'header'); ?&gt; &lt;?php get_template_part('templates/content', 'page'); ?&gt; </code></pre> <p>First question, what does this mean? Where are these template "parts"? Secondly, how do I get rid of the sidebar on some or all pages?</p> <p>Edit: adding code in templates/content-page.php:</p> <pre><code>&lt;?php while (have_posts()) : the_post(); ?&gt; &lt;?php the_content(); ?&gt; &lt;?php wp_link_pages(array('before' =&gt; '&lt;nav class="pagination"&gt;', 'after' =&gt; '&lt;/nav&gt;')); ?&gt; &lt;?php endwhile; ?&gt; </code></pre> <p>I have more goodies. This is from lib/sidebar.php. Looks like Roots has some way of deciding for individual elements, based on flags on them or something, whether to show them. Can someone with PHP knowledge explain what this is likely to do?</p> <pre><code>&lt;?php /** * Determines whether or not to display the sidebar based on an array of conditional tags or page templates. * * If any of the is_* conditional tags or is_page_template(template_file) checks return true, the sidebar will NOT be displayed. * * @param array list of conditional tags (http://codex.wordpress.org/Conditional_Tags) * @param array list of page templates. These will be checked via is_page_template() * * @return boolean True will display the sidebar, False will not * */ class Roots_Sidebar { private $conditionals; private $templates; public $display = true; function __construct($conditionals = array(), $templates = array()) { $this-&gt;conditionals = $conditionals; $this-&gt;templates = $templates; $conditionals = array_map(array($this, 'check_conditional_tag'), $this-&gt;conditionals); $templates = array_map(array($this, 'check_page_template'), $this-&gt;templates); if (in_array(true, $conditionals) || in_array(true, $templates)) { $this-&gt;display = false; } } private function check_conditional_tag($conditional_tag) { if (is_array($conditional_tag)) { return $conditional_tag[0]($conditional_tag[1]); } else { return $conditional_tag(); } } private function check_page_template($page_template) { return is_page_template($page_template); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload