Twenty Eleven Theme Extensions
Exclude sidebar from specific pages (2 posts)

  1. agrolsy
    Posted 2 years ago #


    I'd like to exclude the sidebar from specific pages, but have it on all others. How can that be done?

    (sorry for reposting, but there was no good answer in the last thread, then the solution would be to remove the theme extension and do a completely new theme)


  2. schulte
    Posted 2 years ago #

    For category pages, add the following to line 90 on moztheme2011admin.php:

    $row .= $this->checkBox('sidebar-category', 'Enable the widget sidebar on category pages').$this->crlf();

    and adjust hasSidebar() of moztheme2011.php on line 64 to reflect:

    if ($this->isOptionSet('sidebar-post') || $this->isOptionSet('sidebar-page') || $this->isOptionSet('sidebar-category')) {

    and line 91:

    return $this->isOptionSet('sidebar-post') && is_single() || $this->isOptionSet('sidebar-page') && is_page() || $this->isOptionSet('sidebar-category') && is_category();

    Now this doesn't address specific pages, but does get category pages into the conversation.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Twenty Eleven Theme Extensions
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.