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/File | Description | Conditions | Fallback |
Header and Footer Widget Areas | |||
header.php | Header Widget Area | theme option | |
footer.php | Footer Widget Areas (1-4) | theme option (more than zero) | |
Frontpage and Home Sidebars | |||
front.php | Primary Frontpage Sidebar | theme option | Page/Archive Sidebar* |
subfront.php | Subsidiary Frontpage Sidebar | theme option | Page/Archive SubSidebar* |
home.php | Primary Frontpage Sidebar | theme option | Archive Sidebar |
subhome.php | Subsidiary Frontpage Sidebar | theme option | Archive SubSidebar |
Single Post and Page Sidebars | |||
primary.php | Default Primary Post/Page Sidebar | Unified Sidebar option only | |
subsidiary.php | Default Subsidiary Post/Page Sidebar | Unified SubSidebar option only | |
post.php | Default Primary Post Sidebar | Dual/Posts Sidebar option | |
subpost.php | Default Subsidiary Post Sidebar | Dual/Posts SubSidebar option | |
page.php | Default Primary Page Sidebar | Dual/Pages Sidebar option | |
subpage.php | Default Subsidiary Page Sidebar | Dual/Pages SubSidebar option | |
Extra Sidebars | |||
blank.php | Blank (empty) Sidebar | (creates 'whitespace' columns) | |
subblank.php | Blank (empty) SubSidebar | (creates 'whitespace' columns) | |
search.php | Searchpage Sidebar | theme option | |
subsearch.php | Searchpage SubSidebar | theme option | |
notfound.php | 404 Not Found Sidebar | theme option | Search (if on) |
subnotfound.php | 404 Not Found SubSidebar | theme option | SubSearch (if on) |
Main Archive Sidebars | |||
archive.php | Archive Sidebar | theme option | |
subarchive.php | Archive SubSidebar | theme option | |
Archive-Type Specific Sidebars | |||
category.php | Category Sidebar | Category Sidebar on | |
subcategory.php | Category SubSidebar | Category + Subsidiary on | |
taxonomy.php | Taxonomy Sidebar | Taxonomy Sidebar on | |
subtaxonomy.php | Taxonomy SubSidebar | Taxonomy + Subsidiary on | |
tag.php | Tag Sidebar | Tag Sidebar on | |
subtag.php | Tag SubSidebar | Tag + Subsidiary on | |
author.php | Author Sidebar | Author Sidebar on | |
subauthor.php | Author SubSidebar | Author + Subsidiary on | |
date.php | Date Sidebar | Date Sidebar on | |
subdate.php | Date SubSidebar | Date + Subsidiary on |
Sidebar Value Filters
Filter | Description | Valid Values | Default |
Sidebar Display | |||
skeleton_sidebar_hide | Hide Sidebar | true or false | false |
skeleton_subsidebar_hide | Hide SubSidebar | true or false | false |
Sidebar Output | |||
skeleton_fullwidth_filter | No Sidebar or Subsidebar | true or false | false |
skeleton_sidebar_output | Output Sidebar | true or false | true |
skeleton_subsidebar_output | Output SubSidebar | true or false | true |
Sidebar Position | |||
skeleton_sidebar_position | Absolute Sidebar Position | left, right | theme option |
skeleton_subsidebar_position | Relative SubSidebar Position | internal, external, opposite | theme option |
Sidebar Mode | |||
skeleton_sidebar_mode | Mode for Posts/Pages | off, postsonly, pagesonly, dual, unified | theme option |
skeleton_subsidebar_mode | Mode for Posts/Pages | off, postsonly, pagesonly, dual, unified | theme option |
Sidebar Template Override | |||
skeleton_sidebar_layout_override | Full Template Override | [array]* see above for usage | calculated state |
Sidebar Width Filters
Filter | Description | Valid Values | Default |
Sidebar Column Widths | |||
skeleton_sidebar_columns | Sidebar Column Width | numeric 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_columns | Content Column Width | numeric or number-word (eg. ten) | theme option |
skeleton_grid_columns | Total Grid Columns | numeric or number-word (eg. twenty) | theme option |
← Previous: Page Template Hierarchy | Back to Documentation Index |