Even though BioShip has a lot to it, getting started with BioShip is actually easy.
The main thing to remember is you do not need to setup and use every single feature!
For the majority of projects the default settings for many of the options are great.
So the fastest way to get started is to leave them alone and focus on your design.
';
$html .= '
Practically speaking, this means customizing the Skin layer settings mostly, and
adjusting some Skeleton layer sidebar settings if you need to modify your sidebars.
Most of the Skeleton and all of the Muscle layer settings can be left for later.
';
$html .= '
BioShip has a lot of complex code under the hood to make everything super-flexible.
This means you can leave the more advanced stuff for if and when you actually need it,
confident and relaxed knowing that you really can change anything at all in the future.
And in the meantime, enjoy the simplicity of having everything setup and working sooner!
';
$html .= '
And if and when you are ready to delve deeper, complete documentation is available below.
I hope you enjoy using BioShip and welcome any feedback or improvements.
';}
$html .= 'The Basic Install for BioShip is simple and straightforward as with a standard WordPress Theme,
just download the BioShip Zip file and upload it via the Themes page in your WordPress Appearance admin menu
(or unzip locally and upload to /wp-contents/themes/bioship/ )
';
$html .= 'Alternatively you can do a Preview Install using the instructions below. This allows you to setup
the theme before activating it - a kind of theme sandbox if you will - something traditionally hard to do in WordPress
without creating a development copy of the entire site! (Although, you can do this to a certain extent using the in-built
WordPress Customizer theme preview.)
';
$html .= 'Sidenote: To compensate for different themes having different menu and sidebar data, BioShip attempts
to backup/restore your menus and sidebars when it is activated or deactivated. This helps preserve your menu/sidebar setup
associated with each theme. While Wordpress has improved this process recently, this extra step keeping all the
matching sidebar data for activation/deactivation themes. (Another good way to backup your Widget Layouts is with the
Widget Saver plugin.) ';
$html .= '
Basic Install
(recommended for fresh or development sites)
1. Download the BioShip ZIP (right-click and "Save Linked Content As") to your computer. 2. Login to your Wordpress admin area if you are not already. 3. Visit your Wordpress admin Themes page and upload via the Add New -> Upload page. 4. Activate the theme once it is uploaded. 5. You can now access the Theme Options page via the Appearance menu (or via the top Admin Bar.) ';
$html .= '
Preview Install
(recommended for live sites with an existing theme)
1. Login to your Wordpress admin area if you are not already. 2. Install the Theme Test Drive Plugin from your Wordpress admin Plugins page via Add New and activate. 3. Visit your Theme Test Drive settings page under the Appearance admin menu. 4. Copy the URL of the BioShip ZIP (right-click and "Copy Link Address") and paste into the Easy Install section and Install. 5. Now, you can either: a. Activate the Theme Test Drive for the BioShip theme with Level 10 (administrator) privileges. Remember the theme test
drive for the theme will be active for all administrators until you disable it via this page! You can now access the Theme Options
page via the Appearance menu (or via the top Admin Bar.)
or b. Use a querystring for a temporary preview of the theme on any page, by adding ?theme=bioship to the page address URL in
your browser window. You probably want to change the Theme Options first, so you can access the Theme Options page manually in
this temporary preview mode by going to:
(Generally speaking, if you are the sole site admin of the site then option 5a is fine, otherwise you might
want to go with step 5b so that other site admins do not see the new theme preview while you are developing it!) ';
$html .= '
Theme Updates
(via WordPress Upgrader)
Theme updates are available via your Themes page, just as they would be for any standard theme in the Wordpress.Org
repository. Clicking on Update Available on the BioShip Theme will bring up the Theme Details. From there you
can click on view version x.x.x Details before updating to show you the latest changes, and then you can simply click
on Update Now to update to the latest version.
';
$html .= 'Note: If you downloaded the BioShip package from the WordPress theme repository, that will also be used as the update source.
If you downloaded direct from the BioShip website, the updater will use the website\'s update server via WShadow Theme Updater
(Thanks WShadow!) ';
$html .= '
Manual Theme Update
(for super-fast update testing)
1. Download the latest BioShip ZIP (right-click and "Save Linked Content As") to your computer. 2. Unzip the file locally, then upload it by FTP to: /wp-content/themes/bioship-new/
(make sure you log in FTP as the correct user so owner/group permissions match your install!) 3. Rename the existing /bioship/ subdirectory to /bioship-old/ 4. Rename the /bioship-new/ subdirectory to /bioship/ 5. Check the new version is working and when you are ready delete /bioship-old/
This fast "switcheroo" install will update to the new framework core with no downtime,
and if you have any problems at all you can always switch back to the previous version without hassle. ';
$html .= '
Optimization
For pageload optimization use a caching plugin such as W3 Total Cache.
Preferably disable the W3 Minify Engine and use Better WordPress Minify.
(BioShip 2.0.5+ integrates with Better WordPress Minity to prevent minification of a few resources.
This stops it from breaking the page layout, whereas prior to this it needed to be done manually.) ';
if ($wrap) {$html .= bioship_docs_wrap_close($page);} else {$html .= bioship_docs_navigation($page);}
return $html;
}
// --------------------
// === Child Themes ===
// --------------------
function bioship_docs_child_themes($wrap) {
$page = 'child'; $html = ''; $vthemedoclinks = bioship_docs_links($wrap);
if ($wrap) {$html = bioship_docs_wrap_open($page).'
BioShip Child Theming
';}
$html .= "
Setting up a Child Theme using the BioShip Theme Framework as your Parent Theme is very easy and highly recommended
for best practice development. The main reason being as with any Child Theme you can keep the Parent Theme Framework updated
(allowing for improvements and fixes to the Framework to easily be installed) without losing your own file customizations and
functions. As most websites require some kind of customization of this kind, being able to add and modify your Child Theme
functions.php is the most basic of features that a Parent Theme should support.
";
$html .= "In BioShip, to extend this support, all the core theme functions have been made \"pluggable\" (overrideable.)
In other words each function declaration is wrapped in conditional function_exists checks to make this possible.
So to override any function, simply place a modified copy of a function in your Child Theme's functions.php file,
As WordPress intentionally loads this file before the Parent Theme's functions.php, the modified function
will be loaded instead of the default Parent Theme (Framework) function. (for reference see Child Themes WordPress Codex.)
(Note: Layout Hook changes are a possible exception as the hooks must already exist, see Layout Hooks section for further details on overriding these.)";
// TODO: add note about add_action / add_filter calls being placed INSIDE pluggable functions
$html .= "There are of course many other potential benefits to having a Child Theme, such as being able to override Templates,
Javascript and CSS files - or any other files for that matter. BioShip's extensive file hierarchy allows you to do this for
all theme files and templates (see the File Hierarchy and Template Hierarchy sections.)
Layout hooks can also be modifyied for easy reordering, replacing or adding of page elements (again see Layout Hooks section.)
Plus custom value filters can be used in your functions.php for even further possibilities (see Value Filters section.)
While for simple designs these kinds of advanced customization will be unnecessary - as the existing functions are written to handle a wide variety
of cases very well - having the easy option to override anything can remove makes custom theme development with BioShip a breeze.";
$html .= "
One-Click Child Theme Install
";
$html .= "
To make it even easier, BioShip has One-click Creation for Child Themes, so you can get customizing as soon as possible.
Plus, BioShip auto-transfers your current Parent Theme Setting to your Child Theme when you first activate your it, so there is
no need to set the same settings again if you are moving from using BioShip as a standalone Theme to using a Child Theme.
";
$html .= "
Visit your Theme Options page under the Wordpress admin Appearance menu. Enter a new Child Theme display name
in the box to the right of the layer tabs and click Create Child Theme. The next page will show the creation result in the same
space. Click the activate link there and you are now running your new Child Theme!
";
$html .= "
Manual Child Theme Install
";
$html .= "Unzip your download of BioShip locally and upload the contents of the subdirectory /bioship/child/ via FTP to a subdirectory of your choice in
the /wp-content/themes/ directory. (eg. /wp-content/themes/sweet-child-of-mine/)
";
$html .= "Before Activating: Optionally edit the Name Field of the Child Theme at the top of the style.css file in the directory you created.
(Important Note: if you change this name later you will need to copy the saved Theme Options to the new one in the options table.) This will change the name
of the active theme in your admin area. Once as desired, simply activate the new Child Theme from your Themes page and you're good to go! ";
$html .= "
Preview Child Theme Install
1. Follow either option above but do not activate yet. Instead, make sure you have Theme Theme Drive plugin installed and activated, and either: 2a. Activate the Theme Test Drive for your Child Theme with Level 10 (administrator) privileges. Remember the theme test drive for the theme will be
active until you disable it via this page! You can now access the Theme Options page under the Appearance menu or via the top Admin Bar.
or 2b. Use a querystring for a temporary preview of the Child Theme on any page, by adding ?theme=child-theme-slug to the page address URL
in your browser window (where child-theme is your Child Theme's slug - a lowercase version of Child Theme name with spaces replaced by hyphens.)
For example, you can access the Theme Options manually in this temporary preview mode by going to one of the following URLs:
WordPress Customizer: /wp-admin/customize.php?theme=child-theme-slug
Titan Framework: /wp-admin/themes.php?page=bioship-options&theme=child-theme-slug
Options Framework: /wp-admin/themes.php?page=options-framework&theme=child-theme-slug
";
$html .= "
In this way you can create a new Child Theme skin for your site and activate it once you are satisfied with the new design
result. Again, generally speaking, if you are the sole site admin of the site then option 2a is fine, otherwise you might want to go
with 2b so that other site admins aren't confused by seeing the new in theme preview while you're developing with it.
";
$html .= "
Cloning Child Themes
";
$html .= "
You can also clone any existing Child Theme with one click at the top right of the Theme Options page for that Child Theme.
This allows you to easily 'fork' an existing Child Theme for further development without affecting the live site display.
All files and theme settings will be automatically copied to the new clone Child Theme directory on form submission.
You can then activate the new Child Theme at any point from the Appearance > Themes page.
';}
$html .= "Available BioShip Theme Options are separated into Skin, Muscle and Skeleton sections for all Frameworks! :-) ";
$html .= "This helps organize the design, functionality and templating options respectively (see BioShip Home)
";
$html .= "
Theme Options Frameworks
";
$html .= "
WordPress Customizer
";
$html .= "/admin/customizer.php ";
$html .= "
BioShip supports the in-built WordPress Customizer for all Theme Options with Live Preview updates via the Customizer API.
The Customizer gives you a sidebar panel with Theme Settings and a live preview window that is updated by javascript or refresh.
Bioship implements some custom controls by using the Kirki Library in combination with it's own theme options array.
You will also see some extra panel controls have been added for the Customizer to control sidebar width and position.
If you find the Customizer interface restrictive is it recommended you use the Titan Framework admin page instead.
";
$html .= "
WordPress.Org Compliance
";
$html .= "The Customizer is required to be supported for making BioShip freely available on WordPress.Org theme repository in future.
If you are curious, this step was taken by the Theme Review Team to provide a more consistent experience for the end user.
Personally I prefer using Options or Titan Framework to the Customizer, but all options are available on either it is up to you! :-)
If you are using the WordPress.Org version of BioShip, you will need to install Titan Framework as a plugin to access Titan Admin page.
If you would prefer to use bundled Titan or Options Framework, reinstall the theme from BioShip.Space.
(Note the file update-checker.php is removed from the WP.Org version so that updates are via the WordPress.Org repository.)";
$html .= "
Titan Framework
";
$html .= "/includes/titan/ ";
$html .= "
Titan provides a great modern user interface for modifying all available Theme Settings for BioShip in the one place.
There is a wide variety of controls available via Titan, however only a small number are used to reduce complexity.
Note: admin page output is changed for BioShip so that all tabs are available on the one pageload (like Options Framework.)
Reference: Titan Framework Documentation.
[Theme Settings option_name key: child-theme-slug_options]
";
$html .= "
Options Framework
";
$html .= "/includes/options/ ";
$html .= "
BioShip Theme Options were originally handled by the Options Framework, which is still supported but no longer default.
While there are some minor differences between the Titan and Options Framework, they are very similar in operation.
Reference: Options Framework Documentation.
[Theme Settings option_name key: child_theme_slug]
";
$html .= "
v1.5.0+ Upgrade Notice
";
$html .= "
Since Titan if now used by default after v1.5.0, if you are upgrading from that, use one of the two options given below,
either to switch back to Options Framework or to transfer your existing theme settings to the Titan Framework format. ";
$html .= "
Framework Switching
";
$html .= "
To use Options instead of Titan, create an option name 'theme-slug_framework' and the value of 'options'
Alternatively, you can create a file in your desired theme directory called titanswitch.off
and if you wish to switch back to using Titan again, create a file called titanswitch.on
If either of these files is created it will change the above options value and then delete the file.
After switching between these Frameworks you will want to review your theme settings and resave.
To transfer settings from one framework to another you can use the above querystring on an admin URL (when logged in as administrator or with edit_theme_options capability.)
This is helpful when converting theme settings from Options Framework usage to using Titan Framework instead.
After doing the transfer and switching to the Titan Framework, be sure to check your settings (especially fonts)
on the Theme Options page and save them again to remove again discrepencies.
";
$html .= "
The totheme parameter is optional, if left out it will transfer settings to your current active theme.
Note: Currently only supports transferring existing theme settings TO Titan from Options Framework.
as code is needed for image URLs from Options Framework to be inserted in the media library for Titan, and
development will be moving forward with Titan rather than Options Framework.)
To copy theme settings between any two existing themes using the above query string on an admin URL (when logged in as administrator or with edit_theme_options capability.)
This may be helpful if you created a Child Theme and the theme settings failed to transfer from the Parent Theme.
Or if you simply wish to copy theme settings between themes for some other reason.
";
$html .= "
Other Frameworks
";
// TODO: add more extensive information on Hybrid Core here..?
$html .= "
Hybrid Core
";
$html .= "/includes/hybrid2/ or /includes/hybrid3/ ";
$html .- "Hybrid Core Framework is included with BioShip for a number of useful in-built function and extensions,
such as content template hierarchy, page element attributes and inbuilt Schema.org markup
Hybrid Core is activated via Theme Options -> Skeleton -> Hybrid tab.
Note: for consistency, Hybrid Content Template Hierarchy and attributes are implemented regardless of this.
";
$html .= "
Hybrid Hook
";
$html .= "/includes/hybrid-hook/ ";
$html .= "
All hook positions are automatically made available to the Hybrid Hook plugin (modified for BioShip.)
When activated (via Theme Options -> Skeleton -> Hybrid) you can access Appearance -> Hybrid Hook.
This allows you to easily add content (Text, HTML or Shortcode) to any of the Layout Hook section positions.
(You can also specify a priority if you need to insert between existing hooked functions.)
see the Layout Hook Guide for a detailed hook reference.
";
$html .= "
Foundation
";
$html .= "/includes/foundation5/ or /includes/foundation6/ ";
$html .= "
Foundation by Zurb loading is activated via Theme Options -> Skeleton -> Foundation tab.
";
// TODO: add more extensive information on Foundation here...
$html .= "
BioShip Extensions
";
$html .= "For further theme extensions, see the online BioShip Extensions page.
".PHP_EOL.PHP_EOL; // close final section div
if ($wrap) {$html .= bioship_docs_wrap_close($page);} else {$html .= bioship_docs_navigation($page);}
return $html;
}
// ---------------------
// === Metabox Guide ===
// ---------------------
function bioship_docs_metabox_guide($wrap) {
$page = 'metabox'; $html = ''; $vthemedoclinks = bioship_docs_links($wrap);
if ($wrap) {$html = bioship_docs_wrap_open($page).'
BioShip Theme Metabox
';}
$html .= "
You will find a Theme Settings Metabox on the Writing Screen (above the Publish box) which allows you to override default
display and other settings on a per-post (or per-page) basis, giving you more fine-grained control over many of the page elements
(without having to resort to other more complex workarounds to achieve the same effect, such as one-column templates,
hiding elements with styles and endless page-targeted CSS rules that clutter your stylesheets etc.)
";
$html .= "
These Metabox override settings take priority over filtered theme settings. (ie. Settings -> Filters -> Overrides)
Currently most override options in the metabox are for display (hiding elements) rather than output (removing them.)
When set, CSS style rules (with !important) are added to that page to achieve the desired effect.
[Display Overrides post meta key _bioship_display_overrides (pre-2.1.0: _displayoverrides)]
[Templating Overrides post meta key _bioship_templating_overrides (pre-2.1.0: _templatingoverrides)]
";
$html .= "Hide Display of: Title, Subtitle, Top Meta Line, Bottom Meta Line, Author Bio ";
// TODO: swap meta positions, author bio position ?
// --- content filters overrides ---
$html .= "
Content Filters
";
$html .= "
BioShip provides an easy way to turn off some in-built WordPress content filters on a post/page basis via the metabox.
This can be handy if they are mangling your content for a particular post for some reason and you want an easy fix.
Currently available filters you can disable are: wpautop, wptexturize, convert_smilies, convert_chars
[Filter Overrides post meta key: _bioship_removefilters (pre-2.1.0: _disablefilters)]
";
$html .= "Dropdown overrides for Sidebar and/or SubSidebar: Columns (width), Template to use, and Position.
Special options available under templates for no sidebar output, blank space (empty sidebar), or specifying a custom sidebar template.
(Content column width is also available in this tab for overriding corresponding column width to match changes in sidebar witdth.) ";
$html .= "[Value Filter] skeleton_sidebar_layout_override - available to set template and position on a conditional basis. ";
$html .= "For more details on Sidebars and related filters see the Sidebar Guide. ";
// --- sidebar display overrides ---
$html .= "
You can add CSS style rules for a post/page through this metabox field. Handy if you need to tweak a specific post or page display,
without having all these post-specific rules clogging up your global stylesheet and thus loaded sitewide on every page.
These rules are checked for singular pages and output in the <head> section of the page on display automatically.
There is also an expand/collapse link for better access to viewing and editing this stylesheet rules textarea. There is also
an added Quicksave CSS button for faster changes so you don't have to Update the post just for them to take effect.
[PerPost Styles post meta key: _bioship_perpoststyles (pre-2.1.0: _perpoststyles]
";
if ($wrap) {$html .= bioship_docs_wrap_close($page);} else {$html .= bioship_docs_navigation($page);}
return $html;
}
// ---------------------
// === Value Filters ===
// ---------------------
function bioship_docs_filter_list($wrap) {
$page = 'filters'; $html = ''; $vthemedoclinks = bioship_docs_links($wrap);
if ($wrap) {$html = bioship_docs_wrap_open($page).'
BioShip Value Filters
';}
if (isset($_REQUEST['filter'])) {$selected = $_REQUEST['filter'];} else {$selected = '';}
$html .= "";
// 2.1.1: update filter examples file location to /admin/ (previously /child/)
if ($wrap) {$filterfile = dirname(__FILE__).'/filters.php';}
else {$filterfile = get_template_directory().'/admin/filters.php';}
// 2.0.7: do not use file_get_contents - just to pass Theme Check
// ref: https://wordpress.stackexchange.com/questions/166161/why-cant-the-wp-filesystem-api-read-googlefonts-json#comment240513_166172
// $filterdocs = file_get_contents($filterfile);
$filearray = file($filterfile);
$filterdocs = implode('', $filearray);
// TODO: get/move filter file introduction here ?
// skip filter section index as creating it
$i = 0; // section index
while (strstr($filterdocs, '/==')) {
// --- get next section heading ---
$pos = strpos($filterdocs, '/==');
$filterdocs = substr($filterdocs, $pos, strlen($filterdocs));
$pos = strpos($filterdocs, '==/');
$heading = substr($filterdocs, 0, $pos);
$filterdocs = substr($filterdocs, ($pos+3), strlen($filterdocs));
$heading = trim( str_replace(array('=', '/', "\n"), '', $heading) );
// echo $heading;
$sections[$i]['title'] = $heading;
$sections[$i]['name'] = strtolower(str_replace(' ', '-', $heading));
// --- get filters in section ---
$pos = strpos($filterdocs, '// /==');
$list = substr($filterdocs, 0, $pos);
$filterdocs = substr($filterdocs, $pos, strlen($filterdocs));
$pos = strpos($filterdocs, '==/');
$filterdocs = substr($filterdocs,($pos+3), strlen($filterdocs));
// --- get section comments ---
$pos = strpos($filterdocs,'// /=');
$comments = trim( substr($filterdocs, 0, $pos) );
$sections[$i]['comments'] = str_replace('//', '', $comments);
// echo $sections[$i]['comments'];
$filterdocs = substr($filterdocs, $pos, strlen($filterdocs));
// --- add to filter list ---
$list = trim( str_replace('//', '', $list) );
$list = explode("\n", $list);
$j = 0;
foreach ($list as $filter) {$list[$j] = trim($filter); $j++;}
$sections[$i]['filters'] = $list;
// print_r($list);
// --- get section content ---
$pos = strpos($filterdocs, '/==');
$sections[$i]['content'] = substr($filterdocs, 0, $pos);
// echo "(((".$sections[$i]['content'].")))";
$filterdocs = substr($filterdocs, $pos, strlen($filterdocs));
$pos = strpos($filterdocs, '// /==');
$endpos = strpos($filterdocs, '// /===== END FILTERS');
if ($pos == $endpos) {$filterdocs = '';}
$i++;
}
// print_r($sections);
// 2.1.1: use simple section index
foreach ($sections as $i => $section) {
$list = $section['filters'];
$content = $section['content'];
$j = 0; // reset filter index
foreach ($list as $filter) {
$filter = trim($filter);
$filters[$filter]['slug'] = strtolower(str_replace('_', '-', $filter));
if (!strstr($content, $filter)) {
if (THEMEDOCDEBUG) {
echo "Filter not found: ".$filter." ".PHP_EOL;
echo "
BioShip uses an extended file hierarchy so you can easily override any of the Core Theme Files,
Javascript and CSS Stylesheets by copying the existing files to your Child Theme and modifying them.
";
$html .= "You can also override any Page Templates, Content Templates, Sidebar Templates etc. or create new ones
for Custom Post Types or Post Formats etc. (see the Template Hierarchy Guide for further details on those.)";
$html .= "
BioShip File Hierarchy
";
$html .= "
The file hierarchy will search for the file in this order and use the first matching file it finds:
the Child Theme subdirectories (if relevant)
the main Child Theme directory (ie. 'Stylesheet' directory)
the Parent Theme subdirectories (if relevant)
then main Parent Theme directory (ie. 'Template' directory)
";
$html .= "For example, this allows you to override the Parent Theme (Framework) Stylesheets, Javascripts or Images with ease...";
$html .= "
CSS Stylesheets
";
$html .= "/wp-content/themes/bioship/styles/ ";
$html .= "eg. copy /bioship/styles/stylesheet.css to /child-theme/styles/stylesheet.css ";
$html .= "(or if you prefer, you can also use /css/ or /assets/css/ instead, eg. /child-theme/css/stylesheet.css) ";
$html .= "[Note: custom.css will be auto-loaded if found in either child or parent theme.] ";
$html .= "
Javascripts
";
$html .= "/wp-content/themes/bioship/javascripts/ ";
$html .= "eg. copy /bioship/javascripts/scriptname.js to /child-theme/javascripts/scriptname.js ";
$html .= "(or if you prefer, you can also use /js/ or /assets/js/ instead, eg. /child-theme/js/scriptname.js) ";
$html .= "[Note: custom.js will be auto-loaded if found in either child or parent theme.] ";
$html .= "
Images
";
$html .= "/wp-content/themes/bioship/images/ ";
$html .= "eg. copy /bioship/image/image.png to /child-theme/image/image.png ";
$html .= "(or if you prefer, you can also use /img/ or /assets/img/ instead, eg. /child-theme/img/image.png) ";
$html .= "[Note: gravatar.png will be used for default Gravatar if found in either child or parent theme.] ";
$html .= "
Core Theme File Hierarchy
";
$html .= "
The File Hierarchy also allows you to override Core Theme Files, though in most cases this would be unnecessary,
as generally speaking you would leave these alone for Parent Theme updates and modify individual functions instead.
";
$html .= "All the core theme functions have been made pluggable (overrideable) - with minor exceptions (see below.)
(In other words each function declaration is wrapped in conditional function_exists checks to make this possible.)
So to override any function, simply place a modified copy of it in your Child Theme's functions.php file,
As WordPress intentionally loads this file before the Parent Theme's functions.php, the modified function
will be loaded instead of the default Parent Theme (Framework) function. (see Child Themes on the WordPress Codex.)";
$html .= "(Note: although that is the preffered method, you may still use the File Hierarchy for development overrides however.
For example, if you have found and fixed a bug in the Parent Theme skin.php or grid.php.
As these files do not contain pluggable functions, you can put a modified copy of any of them in your Child Theme
instead and report the bug for the next BioShip update, then recheck those fixes when the update comes out.)";
$html .= "
";
$html .= "(see Template Hierarchy Guide for much more detailed information.) ";
// 2.1.1: fix to type (index-loop)
$html .= "
Base Templates
header.php
Default Header Template
index.php
Default Index Template
loop-index.php
Default Loop Template
footer.php
Default Footer Template
Template Directories
/content/
Content Templates
/content/format/
Post Format Templates
/sidebar/
Sidebar Templates
/templates/
Third Party Templates
";
$html .= "
Library Hierarchy
";
$html .= "
While the File Hierarchy also works for included libraries, if you want to use it for modifying a library,
you will need to copy the entire library directory and subdirectories to your Child Theme to do so.
This is because it will find the library loader file path and the library will load files relative to that.
BioShip of course supports the default WordPress Template Hierarchy.
So you can still implement these top level page templates overrides as you would in a standard theme (eg. page.php, home.php etc.)
';
$html .= '
Remember, due to the File Hierarchy, all template files parts are searched for in your Child Theme directory first.
(This is ideally where you would be placing any customized templates anyway so they are all preserved in Parent Theme updates.)
In all cases the Template Hierarchy will fall back to your Parent Theme (BioShip Framework) if there is no custom template found.
';
$html .= '
However, BioShip extends upon this default system in many different ways to make templating way more flexible.
This of course could make it complex and unfamiliar as well - hence this guide is here to make it comprehensible!
';
$html .= '
First, by default, it uses a single index.php, loop-index.php and content/content.php to handle ALL page conditions.
This keeps things super clean and means you can copy these default templates as starting points for custom ones.
It also means if you prefer, there is no need at all use the template hierarchy - but it is available if needed.
You can instead use the in-built combination of Value Filters and Layout Hooks for customizations.
And since one of the most common thing a project needs is custom sidebars, for that see the Sidebar Guide.
';
$html .= '
Read on for deeper customizations, as you can override sublevel templates and parts at just about any level also...
This is done by simply creating a template file with the proper naming convention to match the desired page condition.
Again, none of these need to be used by default, but are made available for the most flexible template system possible.
';
$html .= "
Base Template Files
/wp-content/bioship/
header.php
Default Header Template
index.php
Default Index Template
loop-index.php
Default Loop Template
footer.php
Default Footer Template
There are several ways to change the loop, header and footer template that is used...
First you can make an unchanged copy of index.php (eg. page.php or archive.php)
and this will automatically load loop/page.php or loop-page.php (you could manually change it too.)
This will work for more specific templates too, eg. taxonomy-term.php would auto-load loop-taxonomy-term.php
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.
";
$html .= "
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.
";
$html .= "
Sidebar Template Override Usage
";
$html .= "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:
";
$html .= "
[0] : Outer Left Sidebar Template
[1] : Inner Left Sidebar Template
Content Columns Area
[2]: Inner Right Sidebar Template
[3] : Outer Right Sidebar Template
";
$html .= "
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.
";
$html .= "
Override Array Examples
";
$html .= "Post with left Sidebar and opposite SubSidebar: Array ( [0] => 'post', [1] => '', [2] => 'subpost', [3] => '' ) ";
$html .= "Post with left Sidebar and opposite SubSidebar: Array ( [0] => 'post', [1] => '', [2] => 'subpost', [3] => '' ) ";
$html .= "Post with left Sidebar and internal SubSidebar: Array ( [0] => 'post', [1] => 'subpost', [2] => '', [3] => '' ) ";
$tml .= "Post with left Sidebar and external SubSidebar: Array ( [0] => 'subpost', [1] => 'post', [2] => '', [3] => '' ) ";
$html .= "Page with right sidebar only: Array ( [0] => '', [1] => '', [2] => 'page', [3] => '' ) ";
$html .= "
Override Filter Example
";
$html .= "This example changes the templates used for single and archive template for a custom post type of 'portfolio'. ";
$html .= '
';
$html .= "add_filter('skeleton_sidebar_layout_override','my_portfolio_sidebars');".PHP_EOL;
$html .= "function my_portfolio_sidebars(\$sidebars) {".PHP_EOL;
$html .= " if (get_post_type() == 'portfolio') {".PHP_EOL;
$html .= " // use portfolio.php for right sidebar and subportfolio.php for external right subsidebar".PHP_EOL;
$html .= " if (is_singular()) {\$sidebars = array('','','portfolio','subportfolio'};}".PHP_EOL;
$html .= " // use portfolio-archive.php for left sidebar and subportfolio-archive.php for right subsidebar".PHP_EOL;
$html .= " elseif (is_archive()) {\$sidebars = array('portfolio-archive','','','subportfolio-archive');}".PHP_EOL;
$html .= " }".PHP_EOL;
$html .= " // to preserve other sidebar behaviour, *always* return the first argument of the filter function".PHP_EOL;
$html .= " return \$sidebars;".PHP_EOL;
$html .= "}".PHP_EOL."
";
// TODO: more filter examples..?
$html .= "
PerPost Metabox Overrides
";
$html .= "
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.
";
$html .= "
Template Hierarchy
";
$html .= "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.";
$html .= "
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
";
if ($wrap) {$html .= bioship_docs_wrap_close($page);} else {$html .= bioship_docs_navigation($page);}
return $html;
}
// -------------------
// === Grid System ===
// -------------------
function bioship_docs_grid_system($wrap) {
$page = 'grid'; $html = ''; $vthemedoclinks = bioship_docs_links($wrap);
if ($wrap) {$html = bioship_docs_wrap_open('grid').'
BioShip Grid System
';}
// 2.1.1: moved example styles to wrapper open function
// --- add content wrapper for grid ---
if ($wrap) {$html .= '
';}
$html .= "
The BioShip Grid System is built primarily upon the Skeleton Boilerplate grid system.
It also incorporates some aspects of other grid systems such as 960GS and Blueprint.
";
$html .= "
Main Layout Grid
";
$html .= "
The main BioShip theme display template is based upon columns with em based unit widths.
This means the grid scales flexibly and well according to browser zoom and base font size.
The main #wrap container contains the header, footer, sidebars and content area.
All of the main grid display is worked out automatically based on your theme settings.
It is worth remembering that sidebar, subsidebar and content column widths of any page
should add to the total grid columns set in your theme settings (the default is sixteen.)
";
$html .= "
Content Grid
";
$html .= "
Within the page #content area, there is an optional content grid available that uses % based widths.
The number of grid columns can be set in theme settings for the container class (default twentyfour.)
Alternatively you can set an explicit number of grid columns using a specific container class of: container_12, container_16, container_20, or container_24 ";
$html .= "
Device Width Breakpoints
";
$html .= "
Both the Main Layout Grid and Content Grid reponsively resize according to device screen width.
The default device breakpoints are 320px, 480px, 640px, 768px, 960px, 1140px and 1200px.
You can change the number and value of these breakpoints via the theme options screen.
(Note that any breakpoint larger than the maximum layout width set will be ignored.)
";
$html .= "
Content Grid Syntax
";
$html .= "Rather than using shortcodes, content columns can be generated using simple <div> element classes. ";
$html .= '
Using outside margins for columns is problematic because it is unknown how many columns may be in a row.
To resolve this problem, inner divs are used in each column to give inner padding instead of outside margins.
Simply add a second div inside the column div with a class of inner to achieve the spacing effect.
The grid stylesheet automatically applies the padding to the inner div to give the column spacing. eg. ";
$html .= '
You can see the combination of resizable responsive grid with inner padding in the following example grid.";
$html .= "(some colours and borders styles are added here for clearer emphasis only.)
";
$example = '
1
11
2
10
3
9
4
8
5
7
6
6
7
5
8
4
9
3
10
2
11
1
';
$html .= $example;
$html .= "
Content Grid Class Reference
";
$html .= "
Extra classes are available for column shifts and offsets, to help you position the grid columns.
Outer margins of different column sizes are applied to achieve these column shifts and offsets.
The below reference table shows you which of the numbered class names have what effect.
';
// extra ref: https://scotch.io/tutorials/cheat-sheet-for-comparing-bootstrap-and-foundation-css-classes
// TODO: notes and example on using small spacer columns
// $html .= "
Spacer Columns
";
$html .= "
Content Grid Compatibility Classes
";
$html .= "
If you prefer, you can use the grid class syntax for 960GS or Blueprint classes by enabling
either of those options in theme settings so the rules are added to the grid stylesheet also.
For Foundation grid, simply enable the Foundation resources separately in theme settings tab
for Foundation (Skeleton layer), and use that grid syntax as you normally would.
';}
if ($wrap) {
// --- include the Hooks file for standalone docs ---
$hookfile = dirname(dirname(__FILE__)).'/hooks.php';
if (!file_exists($hookfile)) {
$html .= "Error: Layout Hooks file was not found!?";
$html .= "