BioShip uses a uniquely flexible Sidebar template system to avoid using restrictive page layout templates. Sidebars output is pre-calculated in skull.php so that <body> classes and other tag classes can be set for the sidebar states.

Another difference you will find from other themes is that all possible sidebars are registered regardless of their setting display state. This is so the you can add widgets to them while inactive, which also allows you to use 'inactive' otherwise sidebars in filters or perpost overrides. Inactive sidebars are however lowercase and styled differently on the widgets page - and listed separate for ease of use.

Sidebar Template Override Usage

The values for the sidebar template array are calculated based on the Theme Settings and page context then filtered.
It is numerical index array of four sidebar template values (filenames without the .php extension) for these positions:

[0] : Outer Left Sidebar Template [1] : Inner Left Sidebar Template Content Columns Area [2]: Inner Right Sidebar Template [3] : Outer Right Sidebar Template

The main filter used to override this layout is skeleton_sidebar_layout_override. This allows you to conditionally use any sidebar in any of the possible positions for complete layout flexibility. Simply set one or two of the four template positions to a template name you wish to use (leaving the other two empty.) Note: when setting opposing sidebars, you can use either position 0 or 1 for left, and either position 2 or 3 for right.

Override Array Examples
Post with left Sidebar and opposite SubSidebar: Array ( [0] => 'post', [1] => '', [2] => 'subpost', [3] => '' )
Post with left Sidebar and opposite SubSidebar: Array ( [0] => 'post', [1] => '', [2] => 'subpost', [3] => '' )
Post with left Sidebar and internal SubSidebar: Array ( [0] => 'post', [1] => 'subpost', [2] => '', [3] => '' )
Post with left Sidebar and external SubSidebar: Array ( [0] => 'subpost', [1] => 'post', [2] => '', [3] => '' )
Page with right sidebar only: Array ( [0] => '', [1] => '', [2] => 'page', [3] => '' )
Override Filter Example
This example changes the templates used for single and archive template for a custom post type of 'portfolio'.
add_filter('skeleton_sidebar_layout_override','my_portfolio_sidebars');
function my_portfolio_sidebars($sidebars) {
    if (get_post_type() == 'portfolio') {
        // use portfolio.php for right sidebar and subportfolio.php for external right subsidebar
        if (is_singular()) {$sidebars = array('','','portfolio','subportfolio'};}
        // use portfolio-archive.php for left sidebar and subportfolio-archive.php for right subsidebar
        elseif (is_archive()) {$sidebars = array('portfolio-archive','','','subportfolio-archive');}
    }
    // to preserve other sidebar behaviour, *always* return the first argument of the filter function
    return $sidebars;
}

PerPost Metabox Overrides

Sidebar templates can also be overridden on a post-by-post basis using the Theme Settings Metabox on the Writing Screen. Note that using these settings will override the filtered sidebar settings also, not just the default sidebar settings. Overrides are available for the sidebar templates, sidebar positions and sidebar widths. (Content width is available on this tab also.) For more information see the BioShip Theme Metabox section.

Template Hierarchy
Instead of overriding the template setting used, you can also override any Sidebar Template at a file level. The BioShip File Hierarchy ensures that the Child Theme sidebar template is used instead if it exists. All default sidebar templates are available in the Parent Theme ready to copy to the Child Theme (each is almost exactly the same - it checks for active widgets in that sidebar and outputs if found.) Note all subsidiary templates are prefixed with 'sub' to distinguish them from primary sidebar templates.

Sidebar Template List

/wp-content/bioship/sidebar/
FileDescriptionConditionsFallback
Header and Footer Widget Areas
header.phpHeader Widget Areatheme option
footer.phpFooter Widget Areas (1-4)theme option (more than zero)
Frontpage and Home Sidebars
front.phpPrimary Frontpage Sidebartheme optionPage/Archive Sidebar*
subfront.phpSubsidiary Frontpage Sidebartheme optionPage/Archive SubSidebar*
home.phpPrimary Frontpage Sidebartheme optionArchive Sidebar
subhome.phpSubsidiary Frontpage Sidebartheme optionArchive SubSidebar
Single Post and Page Sidebars
primary.phpDefault Primary Post/Page SidebarUnified Sidebar option only
subsidiary.phpDefault Subsidiary Post/Page Sidebar  Unified SubSidebar option only
post.phpDefault Primary Post SidebarDual/Posts Sidebar option
subpost.phpDefault Subsidiary Post SidebarDual/Posts SubSidebar option
page.phpDefault Primary Page SidebarDual/Pages Sidebar option
subpage.phpDefault Subsidiary Page SidebarDual/Pages SubSidebar option
Extra Sidebars
blank.phpBlank (empty) Sidebar(creates 'whitespace' columns)
subblank.phpBlank (empty) SubSidebar(creates 'whitespace' columns)
search.phpSearchpage Sidebartheme option
subsearch.phpSearchpage SubSidebartheme option
notfound.php404 Not Found Sidebartheme optionSearch (if on)
subnotfound.php404 Not Found SubSidebartheme optionSubSearch (if on)
 
Main Archive Sidebars
archive.phpArchive Sidebartheme option
subarchive.phpArchive SubSidebartheme option
Archive-Type Specific Sidebars
category.phpCategory SidebarCategory Sidebar on
subcategory.phpCategory SubSidebarCategory + Subsidiary on
taxonomy.phpTaxonomy SidebarTaxonomy Sidebar on
subtaxonomy.phpTaxonomy SubSidebarTaxonomy + Subsidiary on
tag.phpTag SidebarTag Sidebar on
subtag.phpTag SubSidebarTag + Subsidiary on
author.phpAuthor SidebarAuthor Sidebar on
subauthor.phpAuthor SubSidebarAuthor + Subsidiary on
date.phpDate SidebarDate Sidebar on
subdate.phpDate SubSidebarDate + Subsidiary on

Sidebar Value Filters

FilterDescription Valid ValuesDefault
Sidebar Display
skeleton_sidebar_hideHide Sidebartrue or falsefalse
skeleton_subsidebar_hideHide SubSidebartrue or falsefalse
Sidebar Output
skeleton_fullwidth_filterNo Sidebar or Subsidebartrue or falsefalse
skeleton_sidebar_outputOutput Sidebartrue or falsetrue
skeleton_subsidebar_outputOutput SubSidebartrue or falsetrue
Sidebar Position
skeleton_sidebar_positionAbsolute Sidebar Positionleft, righttheme option
skeleton_subsidebar_positionRelative SubSidebar Position  internal, external, oppositetheme option
Sidebar Mode
skeleton_sidebar_modeMode for Posts/Pagesoff, postsonly, pagesonly, dual, unified  theme option
skeleton_subsidebar_modeMode for Posts/Pagesoff, postsonly, pagesonly, dual, unified  theme option
Sidebar Template Override
skeleton_sidebar_layout_override  Full Template Override[array]* see above for usagecalculated state
Sidebar Width Filters
FilterDescription Valid ValuesDefault
Sidebar Column Widths
skeleton_sidebar_columnsSidebar Column Widthnumeric or number-word (eg. four)theme option
skeleton_subsidebar_columns  SubSidebar Column Width  numeric or number-word (eg. two)theme option
Related Width Filters
If you are modifying sidebar columns via a filter you may need to adjust these values to match.
skeleton_content_columnsContent Column Widthnumeric or number-word (eg. ten)theme option
skeleton_grid_columnsTotal Grid Columnsnumeric or number-word (eg. twenty)theme option
← Previous: Page Template HierarchyBack to Documentation Index

Leave a Reply

Your email address will not be published. Required fields are marked *


*