BioShip Documentation

';} $vhtml .= '
'; $vhtml .= ''; $vhtml .= '

Setup

'; $vhtml .= 'Installation and Updates
'; $vhtml .= 'Child Themes
'; $vhtml .= 'Options Frameworks
'; $vhtml .= ''; $vhtml .= '

Options

'; $vhtml .= 'Theme Options Reference
'; $vhtml .= 'Writing Screen Metabox
'; $vhtml .= 'Conditional Value Filters
'; $vhtml .= '

Hierarchies

'; $vhtml .= 'File Guide and Hierarchy
'; $vhtml .= 'Page Template Hierarchy
'; $vhtml .= ''; $vhtml .= '

Layout

'; $vhtml .= 'Sidebar Layout Guide
'; $vhtml .= 'Responsive Grid System
'; $vhtml .= 'Layout Hook Reference
'; $vhtml .= '

Development

'; $vhtml .= 'Theme Constants and Globals
'; $vhtml .= 'Theme Debugging
'; $vhtml .= ''; $vhtml .= '
'; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // Cross Links Generator // --------------------- function bioship_docs_links($vwrap) { global $vdoclinks; $vpages = array( 'install','child-themes','frameworks', 'options','metabox', 'files','templates', 'sidebars','grid','hooks', 'filters','values','debug' ); $vdoclinks = array(); if ($vwrap) { $vdoclinks['index'] = 'docs.php'; foreach ($vpages as $vpage) {$vdoclinks[$vpage] = 'docs.php?page='.$vpage;} } else { $vdoclinks['index'] = '/documentation/'; foreach ($vpages as $vpage) {$vdoclinks[$vpage] = '/documentation/'.$vpage.'/';} } return $vdoclinks; } // Standalone Body Wrapper Open // ----------------------------- function bioship_docs_wrap_open() { global $vdoclinks; // echo $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; $vparseurl = parse_url($_SERVER['SCRIPT_NAME']); $vpath = str_replace('/admin/docs.php','/styles/normalize.css',$vparseurl['path']); $vnormalizeurl = 'http://'.$_SERVER['HTTP_HOST'].$vpath; $vwrapopen = ' '; if (isset($_REQUEST['page'])) {$vwrapopen .= '← Back to Docs Index
';} return $vwrapopen; } // Standalone Body Wrapper Close // ----------------------------- function bioship_docs_wrap_close() { global $vdoclinks; if (isset($_REQUEST['page'])) { $vhtml = '
'; $vhtml .= '← Back to Docs Index
'; } else {$vhtml = '
';} $vhtml .= ''; return $vhtml; } // ============= // === SETUP === // ============= // ---------- // QUICKSTART // ---------- // 2.0.5: add quickstart section function bioship_docs_quickstart($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip QuickStart


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= '

Even though BioShip has a lot to it, getting started with BioShip is actually easy. '; $vhtml .= 'The main thing to remember is you do not need to setup and use every single feature! '; $vhtml .= 'For the majority of projects the default settings for many of the options are great. '; $vhtml .= 'So the fastest way to get started is to leave them alone and focus on your design.

'; $vhtml .= '

Practically speaking, this means customizing the Skin layer settings mostly, and '; $vhtml .= 'adjusting some Skeleton layer sidebar settings if you need to modify your sidebars. '; $vhtml .= 'Most of the Skeleton and all of the Muscle layer settings can be left for later.'; $vhtml .= '

'; $vhtml .= '

BioShip has a lot of complex code under the hood to make everything super-flexible. '; $vhtml .= 'This means you can leave the more advanced stuff for if and when you actually need it, '; $vhtml .= 'confident and relaxed knowing that you really can change anything at all in the future. '; $vhtml .= 'And in the meantime, enjoy the simplicity of having everything setup and working sooner!

'; $vhtml .= '

And if and when you are ready to delve deeper, complete documentation is available below. '; $vhtml .= 'I hope you enjoy using BioShip and welcome any feedback or improvements.'; $vhtml .= '

'; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ------------ // INSTALLATION // ------------ function bioship_docs_install_guide($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Installation


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= '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/ )

'; $vhtml .= '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.)

'; $vhtml .= '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.)
'; $vhtml .= '

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.)
'; $vhtml .= '

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:

WordPress Customizer: /wp-admin/customize.php?theme=bioship
Titan Framework: /wp-admin/themes.php?page=bioship-options&theme=bioship
Options Framework: /wp-admin/themes.php?page=options-framework&theme=bioship

(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!)
'; $vhtml .= '

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.
'; $vhtml .= 'Note: If you downloaded the BioShip package from the WordPress theme repository, that will also be used as the update source.
'; $vhtml .= 'If you downloaded from the BioShip website, updates use the website\'s update server with WShadow Theme Updater'; $vhtml .= ' (Thanks WShadow!)
'; $vhtml .= '
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.
'; $vhtml .= '
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 layout, whereas prior to this it needed to be done manually.)
'; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ------------ // Child Themes // ------------ function bioship_docs_child_themes($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Child Theming


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= "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.

"; $vhtml .= "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. (see Child Themes on the Wordpress Codex.) (Note: Layout Hook changes are a possible exception as the hooks must already exist, see Layout Hooks section for further details.)

"; $vhtml .= "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) - for this see the File Hierarchy section. As well as modifying layout hooks 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 this is kind 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 many unnecessary headaches to your custom theme development.
"; $vhtml .= "

One-Click Child Theme Install

"; $vhtml .= "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 Parent Theme options to Child Theme ones when you first activate your BioShip Child Theme, so there should be no need to set the same options again if you are moving from using BioShip as a Parent Theme to using a Child Theme.

"; $vhtml .= "Visit your Theme Options page under the Wordpress admin Appearance menu. Enter a new Child Theme display name in the box under the layer tabs and click Create Child Theme. Activate on the next page and you are now running your new Child Theme!
"; $vhtml .= "

Manual Child Theme Install

"; $vhtml .= "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/)

"; $vhtml .= "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!
"; $vhtml .= "

Preview Child Theme Install

"; $vhtml .= "1. Follow either option above but do not activate yet. Instead, make sure you have Theme Theme Drive plugin installed and activated, and either:
"; $vhtml .= "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.
"; $vhtml .= "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

"; $vhtml .= "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.
"; $vhtml .= "
Cloning Child Themes
"; $vhtml .= "You can also clone any existing Child Theme with one click at the top of the Theme Options page for that Child Theme.
"; $vhtml .= "This allows you to easily 'fork' an existing Child Theme for further development without affecting the live site.
"; $vhtml .= "All files and theme settings will be automatically copied to the new clone Child Theme directory on form submission.

"; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ---------- // Frameworks // ---------- function bioship_docs_framework_guide($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Frameworks


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= "Available BioShip Theme Options are separated into Skin, Muscle and Skeleton sections for all Frameworks! :-)
"; $bhtml .= "This helps organize the design, functionality and templating options respectively (see BioShip Home)

"; $vhtml .= "

Options Frameworks

"; $vhtml .= "

WordPress Customizer

"; $vhtml .= "/admin/customizer.php
"; $vhtml .= "BioShip supports the in-built WordPress Customizer for all Theme Options with Live Preview updates via the Customizer API.
"; $vhtml .= "The Customizer gives you a sidebar panel with Theme Settings and a live preview window that is updated by javascript or refresh.
"; $vhtml .= "Bioship implements some custom controls by using the Kirki Library in combination with it's own theme options array.
"; $vhtml .= "(you will also see some extra panel controls for sidebar width and position have been added to the Customizer panel.)
"; $vhtml .= "If you find this interface restrictive is it recommended you use the Titan Framework admin page instead.
"; $vhtml .= "
WordPress.Org Compliance
"; $vhtml .= "The Customizer is required to be supported for making BioShip freely available on WordPress.Org theme repository in future.
"; $vhtml .= "If you are curious, this step was taken by the Theme Review Team to provide a more consistent experience for the end user.
"; $vhtml .= "Personally I prefer using Options or Titan Framework to the Customizer, but all options are available so it is up to you! :-)
"; $vhtml .= "If you are using the WP.Org version of BioShip, you will need to install Titan Framework as a plugin to access Titan page.
"; $vhtml .= "If you would prefer to use bundled Titan or Options Framework, reinstall the theme from BioShip.Space.
"; $vhtml .= "(Note the file update-checker.php is removed from the WP.Org version so that updates are via the WordPress.Org repository.)
"; $vhtml .= "

Titan Framework

"; $vhtml .= "/includes/titan/
"; $vhtml .= "Titan provides a great modern user interface for modifying all available Theme Settings for BioShip in the one place.
"; $vhtml .= "There is a wide variety of controls available via Titan, however only a small number are used to reduce complexity.
"; $vhtml .= "Note: admin page output is changed for BioShip so all tabs are available on one pageload like Options Framework. :-)
"; $vhtml .= "Reference: Titan Framework Documentation.
"; $vhtml .= "[Theme Settings option_name key: child-theme-slug_options]
"; $vhtml .= "

Options Framework

"; $vhtml .= "/includes/options/
"; $vhtml .= "BioShip Theme Options were originally handled by the Options Framework, which is still supported but no longer default.
"; $vhtml .= "While there are some minor differences between the Titan and Options Framework, they are very similar in operation.
"; $vhtml .= "Reference: Options Framework Documentation.
"; $vhtml .= "[Theme Settings option_name key: child_theme_slug]
"; $vhtml .= "
v1.5.0+ Upgrade Notice
"; $vhtml .= "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,
"; $vhtml .= "either to switch back to Options Framework or to transfer your existing theme settings to the Titan Framework format.
"; $vhtml .= "
Framework Switching
"; $vhtml .= "To use Options instead of Titan, create an option name 'theme-slug_framework' and the value of 'options'
"; $vhtml .= "Alternatively, you can create a file in your desired theme directory called titanswitch.off
"; $vhtml .= "and if you wish to switch back to using Titan again, create a file called titanswitch.on
"; $vhtml .= "If either of these files is created it will modify the above options value and then delete the file.
"; $vhtml .= "Note this will NOT affect the theme settings saved for either framework, just the option_name used (see above.)
"; $vhtml .= "
Transferring Settings
"; $vhtml .= "?transfersettings=totitan&fromtheme=theme-slug&totheme=theme-slug
"; $vhtml .= "To transfer settings from one framework to another you can use the above querystring on an admin URL (when logged in.)
"; $vhtml .= "This is helpful when converting theme settings from Options Framework usage to using Titan Framework instead.
"; $vhtml .= "After doing the transfer and switching to the Titan Framework, be sure to check your settings (especially fonts)
"; $vhtml .= "on the Theme Options page and save them again to remove again discrepencies.

"; $vhtml .= "The totheme parameter is optional, if left out it will transfer settings to your current active theme.
"; $vhtml .= "Note: Currently only supports transferring existing theme settings TO Titan from Options Framework.
"; $vhtml .= "(as code is needed for image URLs from Options Framework to be inserted in the media library for Titan, and
"; $vhtml .= "development will be moving forward with Titan moreso than Options Framework anyway.)
"; $vhtml .= "
Copying Theme Settings
"; $vhtml .= "?copysettings=yes&fromtheme=theme-slug&totheme=theme-slug
"; $vhtml .= "To copy theme settings between any two existing themes using the above query string on an admin URL (when logged in.)
"; $vhtml .= "This may be helpful if you created a Child Theme and the theme settings failed to transfer from the Parent Theme.
"; $vhtml .= "Or if you simply wish to copy theme settings between themes for some other reason.
"; $vhtml .= "

Other Frameworks

"; $vhtml .= "

Hybrid Core

"; $vhtml .= "/includes/hybrid2/ or /includes/hybrid3/
"; $vhtml .- "Hybrid Core Framework is included with BioShip for a number of useful in-built function and extensions.
"; // TODO: add more extensive information on Hybrid Core here ... $vhtml .= "Hybrid Core is activated via Theme Options -> Skeleton -> Hybrid tab.
"; $vhtml .= "Note: for consistency, Hybrid Content Template Hierarchy and Schema.Org attributes are implemented regardless of this.
"; $vhtml .= "
Hybrid Hook
"; $vhtml .= "/includes/hybrid-hook/
"; $vhtml .= "All hooks are automatically made available to the Hybrid Hook plugin (modified for BioShip.)
"; $vhtml .= "When activated (via Theme Options -> Skeleton -> Hybrid) you can access Appearance -> Hybrid Hook.
"; $vhtml .= "This allows you to easily add content (Text, HTML, or Shortcode) to any of the Layout Hook sections.
"; $vhtml .= "(You can also specify a priority if you need to insert between existing hooked functions.)
"; $vhtml .= "see the Layout Hook Guide for more information.
"; $vhtml .= "

Foundation

"; $vhtml .= "/includes/foundation5/ or /includes/foundation6/
"; $vhtml .= "Foundation by Zurb loading is activated via Theme Options -> Skeleton -> Foundation tab.
"; // TODO: add more extensive information on Foundation here ... $vhtml .= "

BioShip Extensions

"; $vhtml .= "For further extensions, see the online BioShip Extensions page.

"; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ------------- // THEME OPTIONS // ------------- function bioship_docs_option_list($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Theme Options


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} if (isset($_REQUEST['option'])) {$vselected = $_REQUEST['option'];} else {$vselected = '';} $vhtml .= ""; // declare some dummy functions to allow include of options.php if (!function_exists('bioship_options')) { if (!function_exists('add_action')) {function add_action() {} } if (!function_exists('bioship_trace')) {function bioship_trace() {} } if (!function_exists('apply_filters')) {function apply_filters($f,$v) {return $v;} } if (!function_exists('get_categories')) {function get_categories() {} } if (!function_exists('get_template_directory_uri')) {function get_template_directory_uri() {} } if (!function_exists('get_post_types')) {function get_post_types() {} } if (!function_exists('is_rtl')) {function is_rtl() {} } if (!function_exists('get_option')) {function get_option() {} } if (!function_exists('get_intermediate_image_sizes')) {function get_intermediate_image_sizes() {} } // 2.0.7: changed dummy translation arguments to pass theme check if (!function_exists('__')) {function __($s, $d = 'bioship', $a = 'bioship') {return $s;} } // 2.0.8: fix to missing prefixed function if (!function_exists('bioship_apply_filters')) {function bioship_apply_filters($f,$v) {return $v;} } include(dirname(dirname(__FILE__)).'/options.php'); } // $voptions = optionsframework_options(false); // 2.0.5: change to bioship_ prefix $voptions = bioship_options(false); // print_r($voptions); $vlayer = ''; $vsection = ''; foreach ($voptions as $voption) { // Layer Output // ------------ if ($vlayer == '') { $vlayer = 'skin'; $vhtml .= "

SKIN

".PHP_EOL; $vhtml .= "
".PHP_EOL; } elseif ( ($voption['type'] == 'heading') && ($voption['id'] != $vlayer) ) { $vlayer = $voption['id']; $vhtml .= "

".PHP_EOL.PHP_EOL; $vhtml .= "

".strtoupper($vlayer)."

".PHP_EOL; $vhtml .= "
".PHP_EOL; } elseif ( (isset($voption['hidden'])) && ($voption['hidden']) ) { if ($vlayer != 'hidden') { $vlayer = 'hidden'; $vhtml .= "

".PHP_EOL.PHP_EOL; $vhtml .= "

".strtoupper($vlayer)."

".PHP_EOL; $vhtml .= "';} $vsection = strtolower($voption['name']); $vhtml .= "

".$voption['name']."

".PHP_EOL; if (isset($voption['desc'])) {$vhtml .= $voption['desc']."
";} $vhtml .= "".PHP_EOL; // close final heading div $vhtml .= "

".PHP_EOL.PHP_EOL; // close final section div if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ------------- // Metabox Guide // ------------- function bioship_docs_metabox_guide($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Theme Metabox


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= "You will find a Theme Settings Metabox on the post/page writing screen which allows you to override default display
"; $vhtml .= "and other settings on a per-post or per-page basis, giving you fine-grained control over many of the page elements.
"; $vhtml .= "(without having to resort to other more complex workarounds to achieve the same effect, such as one-column templates,
"; $vhtml .= "hiding elements with styles and endless page-targeted CSS rules that clutter your stylesheets etc.)
"; $vhtml .= "Note: Metabox overrides take priority over filtered theme settings. (ie. Settings -> Filtered -> Overrides)

"; $vhtml .= "Currently most override options in the metabox are for display (hiding elements) rather than output (removing them.)
"; $vhtml .= "Inline CSS is added to a particular page to achieve this (more actual output overrides will be added at a later stage.)
"; $vhtml .= "[Display overrides are stored in post meta as an array with (hidden) meta key _displayoverrides.]
"; $vhtml .= "[Templating overrides are stored in post meta as an array with (hidden) meta key _templatingoverrides.]

"; $vhtml .= "

Layout Display Overrides

"; $vhtml .= "

General Layout

"; $vhtml .= "No Wrap Margin (Full Width Page), Hide Header Section, Hide Footer Section
"; // TODO: logo / header texts / header extras - footer extras / site credit $vhtml .= "

Navigation

"; $vhtml .= "Hide Display of: Main Navigation, Secondary Nav, Header Menu, Footer Menu, Breadcrumbs, PageNavi
"; $vhtml .= "

Sidebar Overrides

"; $vhtml .= "

Sidebar Output Overrides

"; $vhtml .= "Dropdown overrides for Sidebar and/or SubSidebar: Columns (width), Template to use, and Position.
"; $vhtml .= "Special options available under templates for no sidebar output or a blank (empty sidebar) space.
"; $vhtml .= "Content column width is also available in this tab for override corresponding column width to match.
"; $vhtml .= "[Value Filter] skeleton_sidebar_layout_override - available to set template and position on a conditional basis.
"; $vhtml .= "For more details on Sidebars and related filters see the Sidebar Guide.
"; $vhtml .= "

Sidebar Display Overrides

"; $vhtml .= "Hide Display of: Sidebar, SubSidebar, Header Widgets, Footer Widgets, Footer 1/2/3/4
"; $vhtml .= "

Content Overrides

"; $vhtml .= "

Thumbnail/Featured Image

"; $vhtml .= "Override default output thumbnail size (or none), and display (hide) override for thumbnail image.
"; $vhtml .= "

Content Display Overrides

"; $vhtml .= "Hide Display of: Title, Subtitle, Top Meta Line, Bottom Meta Line, Author Bio
"; // TODO: swap meta positions, author bio position? $vhtml .= "

Content Filters

"; $vhtml .= "BioShip provides an easy way to turn off some in-built WordPress content filters on a post/page basis via the metabox.
"; $vhtml .= "This can be handy if they are mangling your content for a particular post for some reason and you want an easy fix.
"; $vhtml .= "Currently available filters you can disable are: wpautop, wptexturize, convert_smilies, convert_chars
"; $vhtml .= "[Filter overrides are stored in the post meta with (hidden) meta key _disablefilters]
"; $vhtml .= "

PerPost Styles

"; $vhtml .= "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.
"; $vhtml .= "without having all these post-specific rules clogging up your global stylesheet and thus loaded sitewide on every page.
"; $vhtml .= "These rules are checked for singular pages and output in the <head> section of the page on display automatically.
"; $vhtml .= "There is also an expand/collapse link for better access to viewing and editing this stylesheet rules textarea.
"; $vhtml .= "[PerPost Styles are stored in the post meta with (hidden) meta key _perpoststyles]
"; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ------------- // VALUE FILTERS // ------------- function bioship_docs_filter_list($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Value Filters


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} if (isset($_REQUEST['filter'])) {$vselected = $_REQUEST['filter'];} else {$vselected = '';} $vhtml .= ""; if ($vwrap) {$vfilterfile = dirname(dirname(__FILE__)).'/child/filters.php';} else {$vfilterfile = get_template_directory().'/child/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 // $vfilterdocs = file_get_contents($vfilterfile); $vfilearray = file($vfilterfile); $vfilterdocs = implode('', $vfilearray); // TODO: get/move filter file introduction here? // skip section index as creating it $vi = 0; // section index while (strstr($vfilterdocs,'/==')) { // get next section heading $vpos = strpos($vfilterdocs,'/=='); $vfilterdocs = substr($vfilterdocs,$vpos,strlen($vfilterdocs)); $vpos = strpos($vfilterdocs,'==/'); $vheading = substr($vfilterdocs,0,$vpos); $vfilterdocs = substr($vfilterdocs,($vpos+3),strlen($vfilterdocs)); $vheading = trim( str_replace(array('=','/',"\n"),'',$vheading) ); // echo $vheading; $vsections[$vi]['title'] = $vheading; $vsections[$vi]['name'] = strtolower(str_replace(' ','-',$vheading)); // get filters in section $vpos = strpos($vfilterdocs,'// /=='); $vlist = substr($vfilterdocs,0,$vpos); $vfilterdocs = substr($vfilterdocs,$vpos,strlen($vfilterdocs)); $vpos = strpos($vfilterdocs,'==/'); $vfilterdocs = substr($vfilterdocs,($vpos+3),strlen($vfilterdocs)); // get section comments $vpos = strpos($vfilterdocs,'// /='); $vcomments = trim( substr($vfilterdocs,0,$vpos) ); $vsections[$vi]['comments'] = str_replace('//','',$vcomments); // echo $vsections[$vi]['comments']; $vfilterdocs = substr($vfilterdocs,$vpos,strlen($vfilterdocs)); $vlist = trim( str_replace('//','',$vlist) ); $vlist = explode("\n",$vlist); $vj = 0; foreach ($vlist as $vfilter) {$vlist[$vj] = trim($vfilter); $vj++;} $vsections[$vi]['filters'] = $vlist; // print_r($vlist); $vpos = strpos($vfilterdocs,'/=='); $vsections[$vi]['content'] = substr($vfilterdocs,0,$vpos); // echo "(((((".$vsections[$vi]['content'].")))))"; $vfilterdocs = substr($vfilterdocs,$vpos,strlen($vfilterdocs)); $vpos = strpos($vfilterdocs,'// /=='); $vendpos = strpos($vfilterdocs,'// /===== END FILTERS'); if ($vpos == $vendpos) {$vfilterdocs = '';} $vi++; } // print_r($vsections); $vi = 0; foreach ($vsections as $vsection) { $vlist = $vsection['filters']; $vcontent = $vsection['content']; $vj = 0; // filter index foreach ($vlist as $vfilter) { $vfilter = trim($vfilter); $vfilters[$vfilter]['slug'] = strtolower(str_replace('_','-',$vfilter)); if (!strstr($vcontent,$vfilter)) { echo "Filter not found: ".$vfilter."
".PHP_EOL; echo $vcontent; } else { $vpos = strpos($vcontent,$vfilter); $vtempa = substr($vcontent,0,$vpos); $vtempb = substr($vcontent,$vpos,strlen($vcontent)); $vposa = strrpos($vtempa,'/='); $vtempc = substr($vtempa,($vposa+2),strlen($vtempa)); $vposb = strpos($vtempc,'=/'); $vfilters[$vfilter]['name'] = trim(substr($vtempc,0,$vposb)); $vposc = strrpos($vtempa,'add_filter'); $vexample = trim( substr($vtempa,$vposc,strlen($vtempc)) ); $vtempa = substr($vtempa,0,$vposa); if (strstr($vtempb,'/=')) {$vpos = strpos($vtempb,'/=');} else {$vpos = strlen($vtempb);} $vexample .= substr($vtempb,0,$vpos); $vtempb = trim( substr($vtempb,$vpos,strlen($vtempb)) ); if (THEMEDOCDEBUG) { if (!strstr($vexample,'return')) { echo "Warning: no return for ".$vfilter.":
".PHP_EOL; echo $vfilters[$vfilter]['content']; } } if (substr($vexample,-3,3) == '// ') {$vexample = substr($vexample,0,(strlen($vexample)-3));} // echo "(((".$vexample.")))"; $vfilters[$vfilter]['example'] = $vexample; $vcontent = $vtempa.$vtempb; $vj++; } } $vi++; } // print_r($vfilters); $vhtml .= ""; // Conditional Filter note... // $vhtml .= 'Note: For modifying options in different contexts, see Conditional Filter Examples.

'; foreach ($vsections as $vsection) { $vsectionhtml = '

'.$vsection['title'].'

'; $vsectionhtml .= '
$vfiltershtml = ''; $vfoundfilter = false; foreach ($vsection['filters'] as $vfilter) { $vfiltershtml .= ''; $vfiltershtml .= '

'.$vfilter." : ".$vfilters[$vfilter]['name'].'

'; $vfiltershtml .= '
if ($vselected == $vfilter) {$vfoundfilter = true; $vfiltershtml .= '>';} else {$vfiltershtml .= ' style="display:none;">';} $vfiltershtml .= '
'.$vfilters[$vfilter]['example'].'
'; $vfiltershtml .= '
'; // end filter } if (!$vfoundfilter) {$vsectionhtml .= ' style="display:none;">';} else {$vsectionhtml .= '>';} $vhtml .= $vsectionhtml.$vfiltershtml; $vhtml .= '
'; // end section } if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // =========== // HIERARCHIES // =========== // ------------------- // FILES AND HIERARCHY // ------------------- function bioship_docs_file_hierarchy($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Files and Hierarchy


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= "BioShip uses an extended file hierarchy so you can easily override any of the Core Theme Files,
"; $vhtml .= "Javascript and CSS Stylesheets by copying the existing files to your Child Theme and modifying them.

"; $vhtml .= "You can also override any Page Templates, Content Templates, Sidebar Templates etc. or create new ones
"; $vhtml .= "for Custom Post Types or Post Formats etc. (see the Template Hierarchy Guide for further details.)
"; $vhtml .= "

BioShip File Hierarchy

"; $vhtml .= "The file hierarchy will search for the file in this order and use the first matching file it finds:
  1. the Child Theme subdirectories (if relevant)
  2. the main Child Theme directory (ie. 'Stylesheet' directory)
  3. the Parent Theme subdirectories (if relevant)
  4. then main Parent Theme directory (ie. 'Template' directory)
"; $vhtml .= "For example, this allows you to override the Parent Theme (Framework) Stylesheets, Javascripts or Images with ease...
"; $vhtml .= "
CSS Stylesheets
"; $vhtml .= "/wp-content/themes/bioship/styles/
"; $vhtml .= "eg. copy /bioship/styles/stylesheet.css to /child-theme/styles/stylesheet.css
"; $vhtml .= "(or if you prefer, you can also use /css/ or /assets/css/ instead, eg. /child-theme/css/stylesheet.css)
"; $vhtml .= "[Note: custom.css will be auto-loaded if found in either child or parent theme.]
"; $vhtml .= "
Javascripts
"; $vhtml .= "/wp-content/themes/bioship/javascripts/
"; $vhtml .= "eg. copy /bioship/javascripts/scriptname.js to /child-theme/javascripts/scriptname.js
"; $vhtml .= "(or if you prefer, you can also use /js/ or /assets/js/ instead, eg. /child-theme/js/scriptname.js)
"; $vhtml .= "[Note: custom.js will be auto-loaded if found in either child or parent theme.]
"; $vhtml .= "
Images
"; $vhtml .= "/wp-content/themes/bioship/images/
"; $vhtml .= "eg. copy /bioship/image/image.png to /child-theme/image/image.png
"; $vhtml .= "(or if you prefer, you can also use /img/ or /assets/img/ instead, eg. /child-theme/img/image.png)
"; $vhtml .= "[Note: gravatar.png will be used for default Gravatar if found in either child or parent theme.]
"; $vhtml .= "

Core Theme File Hierarchy

"; $vhtml .= "The File Hierarchy also allows you to override Core Theme Files, though in most cases this would be unnecessary,
"; $vhtml .= "as generally speaking you would leave these alone for Parent Theme updates and modify individual functions instead.

"; $vhtml .= "All the core theme functions have been made pluggable (overrideable) - with minor exceptions (see below.)
"; $vhtml .= "(In other words each function declaration is wrapped in conditional function_exists checks to make this possible.)
"; $vhtml .= "So to override any function, simply place a modified copy of it in your Child Theme's functions.php file,
"; $vhtml .= "As WordPress intentionally loads this file before the Parent Theme's functions.php, the modified function
"; $vhtml .= "will be loaded instead of the default Parent Theme (Framework) function. (see Child Themes on the WordPress Codex.)

"; $vhtml .= "(Note: although that is the preffered method, you may still use the File Hierarchy for development overrides however.
"; $vhtml .= "For example, if you have found and fixed a bug in the Parent Theme skin.php, grid.php or hooks.php
"; $vhtml .= "As these files do not contain pluggable functions, you can put a modified copy of any of them in your Child Theme
"; $vhtml .= "instead and report the bug for the next BioShip update, then recheck those fixes when the update comes out.)

"; $vhtml .= "

Core Theme Files

"; $vhtml .= "/wp-content/themes/bioship
"; $vhtml .= "
Theme Setup Files
functions.phpTheme Setup and Loader
options.phpTheme Options and Fonts
hooks.phpLayout Hooks and Labels[standalone definitions, no functions]
compat.phpTheme Backwards Compatibility
Core Layer Files
skull.phpTheme Helpers and Head Setup
skeleton.phpSkeleton Page Templating Functions
muscle.phpMuscle Extended Theme Functions
skin.phpSkin Dynamic CSS Styles Output[standalone, functions not pluggable]
grid.phpGrid System Dynamic CSS Output[standalone, functions not pluggable]
Admin Files
admin/admin.phpAdmin-only Functions
admin/customizer.phpCustomizer Integration
admin/tracer.phpTheme Function Debug Tracer
admin/docs.phpDocumentation Generator
"; $vhtml .= "

Default Template Files

"; $vhtml .= "(see Template Hierarchy Guide for much more detailed information.)
"; $vhtml .= "
Base Templates
header.phpDefault Header Template
index.phpDefault Index Template
index-loop.phpDefault Loop Template
footer.phpDefault Footer Template
Template Directories
/content/Content Templates
/content/format/Post Format Templates
/sidebar/Sidebar Templates
/templates/Third Party Templates
"; $vhtml .= "

Library Hierarchy

"; $vhtml .= "While the File Hierarchy also works for included libraries, if you want to use it for modifying a library,
"; $vhtml .= "you will need to copy the entire library directory and subdirectories to your Child Theme to do so.
"; $vhtml .= "This is because it will find the library loader file path and the library will load files relative to that.

"; $vhtml .= "
Library Directories
/includes/Default Includes
/includes/titan/Titan Framework
/includes/options/Options Framework
/includes/kirki/Kirki Library
/includes/hybrid2/Hybrid Core 2
/includes/hybrid3/Hybrid Core 3
/includes/hybrid-hook/Hybrid Hook
/includes/foundation5/Foundation 5
/includes/foundation6/Foundation 6
"; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ------------------ // TEMPLATE HIERARCHY // ------------------ function bioship_docs_template_hierarchy($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Template Hierarchy


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= 'BioShip of course supports the default WordPress Template Hierarchy.
'; $vhtml .= 'So you can still implement these top level page templates overrides as you would in a standard theme (eg. page.php, home.php etc.)

'; $vhtml .= 'Remember, due to the File Hieararchy, all template files parts are searched for in your Child Theme directory first.
'; $vhtml .= '(This is ideally where you would be placing any customized templates anyway so they are all preserved in framework updates.)
'; $vhtml .= 'In all cases the Template Hierarchy will fall back to your Parent Theme (BioShip Framework) if there is no custom template.

'; $vhtml .= 'However, BioShip extends upon this default system in many different ways to make templating way more flexible.
'; $vhtml .= 'This of course could make it complex and unfamiliar as well - hence this guide is here to make it comprehensible!

'; $vhtml .= 'First, by default, it uses a single index.php, loop-index.php and content/content.php to handle ALL page conditions.
'; $vhtml .= 'This keeps things super clean and means you can copy these default templates as starting points for custom ones.
'; $vhtml .= 'It also means if you prefer, there is no need at all use the template hierarchy - but it is available if needed.
'; $vhtml .= 'You can instead use the in-built combination of Value Filters and Layout Hooks for customizations.
'; $vhtml .= 'And since one of the most common thing a project needs is custom sidebars, for that see the Sidebar Guide.

'; $vhtml .= 'Read on for deeper customizations, as you can override sublevel templates and parts at just about any level also...
'; $vhtml .= 'This is done by simply creating a template file with the proper naming convention to match the desired page condition.
'; $vhtml .= 'Again, none of these need to be used by default, but are made available for the most flexible template system possible.

'; $vhtml .= " "; $vhtml .= "

Base Template Files

/wp-content/bioship/
header.phpDefault Header Template
index.phpDefault Index Template
loop-index.phpDefault Loop Template
footer.phpDefault 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
Loop Templates
loop/{string}.phploop-{string}.php[Value Filter:string] skeleton_loop_template (no default)
loop/{filename}.phploop-{filename}.phpmatches base template filename eg. home.php -> loop-home.php
loop/{pagecontext}.phploop-{pagecontext}.phpfrontpage, home, 404, search
loop/{archivecontext}.phploop-{archivecontext}.php[archive only] category, taxonomy, tag, author, date, archive (fallback)
loop/{post-type}.phploop-{post-type}.php[singular only] {post-type}
loop/index.phploop-index.phpDefault Loop Template
HierarchyArray Filter[Value Filter:array] skeleton_loop_templates
Header Templates
header/{string}.phpheader-{string}.php[Value Filter:string] skeleton_header_template (no default)
header/{filename}.phpheader-{filename}.phpmatches base template filename, eg. home.php -> header-home.php
header/{pagecontext}.phpheader-{pagecontext}.phpfrontpage, home, 404, search
header/{archivecontext}.phpheader-{archivecontext}.php[archive only] category, taxonomy, tag, author, date, archive (fallback)
header/{pagecontext}.phpheader-{pagecontext}.php[singular only] {post-type}
header/index.phpheader-index.phpDefault Header Template
HierarchyArray Filter[Value Filter:array] skeleton_header_templates
Footer Templates
footer/{string}.phpfooter-{string}.php[Value Filter:string]skeleton_footer_template (no default)
footer/{filename}.phpfooter-{filename}.phpmatches base template filename, eg. home.php -> header-home.php
footer/{pagecontext}.phpfooter-{pagecontext}.phpfrontpage, home, 404, search
footer/{archivecontext}.phpfooter-{archivecontext}.php[archive only] category, taxonomy, tag, author, date, archive (fallback)
footer/{post-type}.phpfooter-{post-type}.php[singular only] {post-type}
footer/index.phpfooter-index.phpDefault Footer Template
HierarchyArray Filter[Value Filter:array] skeleton_footer_templates
The Content Template Hierarchy handles all different templates for Custom Post Types and Post Formats.
In other words, if a specific matching template is not found, it falls back to the first one that is found.
Note: For consistency, the Hybrid content template hierarchy whether full Hybrid Core is activated or not.

Content Template Hierarchy

content/attachment-{mimetype}.phpcontent-attachment-{mimetype}.phpif is_attachment()
content/{posttype}-{postformat}.phpcontent-{posttype}-{postformat}.phpcombination of post type and post format
content/{postformat}.phpcontent-{postformat}.phpaside, audio, chat, image, gallery, link, quote, status, video
content/{posttype}.phpcontent-{posttype}.phppost, page or other custom post type
content.phpcontent/content.phpDefault Content Template
HierarchyArray Filter[Value Filter:array] hybrid_content_hierarchy
DirectoryString Filter[Value Filter:string] skeleton_content_template_directory
If you wish to use a split hieararchy you can optionally create and use an /archive/ template directory also.
Again, this hierarchy falls back to the Content Template Hierarchy after, which handles all page conditions.

Archive Template Hierarchy

(optional)
archive/attachment-{mimetype}.phpoptional template directoryif is_attachment()
archive/{posttype}-{postformat}.phpoptional template directorycombination of post type and post format
archive/{postformat}.phpoptional template directoryaside, audio, chat, image, gallery, link, quote, status, video
archive/{posttype}.phpoptional template directorypost, page or other custom post type
archive/content.phpoptional template directoryArchive Content Template
DirectoryString Filter[Value Filter:string] skeleton_archive_template_directory

Other Content Templates

/wp-content/bioship/content/
author-bio.phpDefault Author Bio Template
loop-nav.phpDefault Loop Navigation Template
loop-meta.phpDefault Loop Meta Template
error.phpDefault Error Page Template

Comments Template Hierarchy

/wp-content/bioship/content/
comments-{posttype}-{postformat}.php[not implemented yet]
comments-{postformat}.php[not implemented yet]
comments-{posttype}.phpCustom Post Type Comments Template
comments.phpDefault Main Comments Template
comments-nav.phpDefault Comments Navigation Template
comments-error.phpDefault Comments Error Template

Sidebar Template Hierarchy

/wp-content/bioship/sidebar/
Sidebar and SubSidebar Templates are available by default for all sidebar contexts.
see the BioShip Sidebar Guide for more detailed information.
Third Party Templates
/wp-content/bioship/templates/
/templates/ajax-load-more/AJAX Load More Repeater Templatecopy/paste into Repeater Template field
/templates/theme-my-login/Theme My Login Templatesmodified for Theme Integration
/templates/woocommerce/Alternative WooCommerce Templatescan be used instead of the default /woocommerce/
/templates/skeleton/Legacy Skeleton Templatesfor reference only [deprecated]
"; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ====== // LAYOUT // ====== // ------------- // SIDEBAR GUIDE // ------------- function bioship_docs_sidebar_guide($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Sidebar Guide


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= "BioShip uses a uniquely flexible Sidebar template system to avoid using restrictive page layout templates.
"; $vhtml .= "Sidebars output is pre-calculated in skull.php so <body> and other tag classes can be set for sidebar states.

"; $vhtml .= "All sidebars are registered regardless of their setting display state so the you can add widgets to them while inactive.
"; $vhtml .= "(Inactive sidebars are however lowercase and styled differently on the widgets page - and listed separate for ease of use.)

"; $vhtml .= "

Sidebar Template Override Usage

"; $vhtml .= "The values for the sidebar template array are calculated based on the Theme Settings and page context then filtered.
"; $vhtml .= "It is numerical index array of four sidebar template values (filenames without the .php extension) for these positions:
"; $vhtml .= "
[0] : Outer Left Template [1] : Inner Left Template Content Column [2]: Inner Right Template [3] : Outer Right Template

"; $vhtml .= "The main filter used to override this layout is skeleton_sidebar_layout_override.
"; $vhtml .= "This allows you to conditionally use any sidebar in any of the possible positions for complete layout flexibility.
"; $vhtml .= "Simply set one or two of the four template positions to a template name you wish to use (leaving the other two empty.)
"; $vhtml .= "Note: when setting opposing sidebars, you can use either position 0 or 1 for left, and either position 2 or 3 for right.
"; $vhtml .= "
Override Array Examples
"; $vhtml .= "Post with left Sidebar and opposite SubSidebar: Array ( [0] => 'post', [1] => '', [2] => 'subpost', [3] => '' )
"; $vhtml .= "Post with left Sidebar and opposite SubSidebar: Array ( [0] => 'post', [1] => '', [2] => 'subpost', [3] => '' )
"; $vhtml .= "Post with left Sidebar and internal SubSidebar: Array ( [0] => 'post', [1] => 'subpost', [2] => '', [3] => '' )
"; $vhtml .= "Post with left Sidebar and external SubSidebar: Array ( [0] => 'subpost', [1] => 'post', [2] => '', [3] => '' )
"; $vhtml .= "Page with right sidebar only: Array ( [0] => '', [1] => '', [2] => 'page', [3] => '' )
"; $vhtml .= "
Override Filter Example
"; $vhtml .= "This example changes the templates used for single and archive template for a custom post type of 'portfolio'.
"; $vhtml .= '
';
	$vhtml .= "add_filter('skeleton_sidebar_layout_override','my_portfolio_sidebars');".PHP_EOL;
	$vhtml .= "function my_portfolio_sidebars(\$sidebars) {".PHP_EOL;
	$vhtml .= "    if (get_post_type() == 'portfolio') {".PHP_EOL;
	$vhtml .= "        // use portfolio.php for right sidebar and subportfolio.php for external right subsidebar".PHP_EOL;
	$vhtml .= "        if (is_singular()) {\$sidebars = array('','','portfolio','subportfolio'};}".PHP_EOL;
	$vhtml .= "        // use portfolio-archive.php for left sidebar and subportfolio-archive.php for right subsidebar".PHP_EOL;
	$vhtml .= "        elseif (is_archive()) {\$sidebars = array('portfolio-archive','','','subportfolio-archive');}".PHP_EOL;
	$vhtml .= "    }".PHP_EOL;
	$vhtml .= "    // to preserve other sidebar behaviour, *always* return the first argument of the filter function".PHP_EOL;
	$vhtml .= "    return \$sidebars;".PHP_EOL;
	$vhtml .= "}".PHP_EOL."

"; // TODO: more filter examples..? $vhtml .= "
PerPost Metabox Overrides
"; $vhtml .= "Sidebar templates can also be overridden on a post-by-post basis using the Theme Metabox on the post writing/editing screen.
"; $vhtml .= "Note that using these settings will override the filtered sidebar settings also, not just the default sidebar settings.
"; $vhtml .= "Overrides are available for the sidebar templates, sidebar positions, sidebar widths (and content width also.)
"; $vhtml .= "For more information see the BioShip Theme Metabox section.
"; $vhtml .= "
Template Hierarchy
"; $vhtml .= "Instead of overriding the template used, you can also override any particular sidebar template file.
"; $vhtml .= "The BioShip File Hierarchy ensures that the Child Theme sidebar template is used instead if it exists.
"; $vhtml .= "All default sidebar templates have been created in the Parent Theme ready to copy to the Child Theme.
"; $vhtml .= "(each is almost exactly the same - checks for active widgets in that sidebar and outputs if found.)
"; $vhtml .= "All subsidiary templates are prefixed with 'sub' to distinguish them from primary sidebar templates.
"; $vhtml .= "

Sidebar Template List

"; $vhtml .= "/wp-content/bioship/sidebar/
"; $vhtml .= "FileDefault Subsidiary Post SidebarDefault Subsidiary Page Sidebar
DescriptionConditionsFallback
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.phpDual/Posts SubSidebar option
page.phpDefault Primary Page SidebarDual/Pages Sidebar option
subpage.phpDual/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

"; $vhtml .= "

Sidebar Value Filters

"; $vhtml .= "
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
"; $vhtml .= "
Sidebar Width Filters
"; $vhtml .= "
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
"; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ----------- // GRID SYSTEM // ----------- function bioship_docs_grid_system($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Grid System


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} if ($vwrap) { $vhtml .= ''; // load grid.php here for offline example displays $vhtml .= ''; } if ($vwrap) {$vhtml .= '
';} // $vhtml .= "Well, you're here early aren't you? Please check back soon..."; $vhtml .= "The BioShip Grid System is built primarily upon the Skeleton Boilerplate grid system.
"; $vhtml .= "It also incorporates some aspects of other grid systems such as 960GS and Blueprint.
"; $vhtml .= "

Main Layout Grid

"; $vhtml .= "The main BioShip theme display template is based upon columns with em based unit widths.
"; $vhtml .= "This means the grid scales flexibly and well according to browser zoom and base font size.
"; $vhtml .= "The main #wrap container contains the header, footer, sidebars and content area.
"; $vhtml .= "All of the main grid display is worked out automatically based on your theme settings.
"; $vhtml .= "It is worth remembering that sidebar, subsidebar and content column widths of any page
"; $vhtml .= "should add to the total grid columns set in your theme settings (the default is sixteen.)
"; $vhtml .= "

Content Grid

"; $vhtml .= "Within the page #content area, there is an optional content grid available that uses % based widths.
"; $vhtml .= "The number of grid columns can be set in theme settings for the container class (default twentyfour.)
"; $vhtml .= "Alternatively you can set an explicit number of grid columns using a specific container class of:
"; $vhtml .= "container_12, container_16, container_20, or container_24
"; $vhtml .= "
Device Width Breakpoints
"; $vhtml .= "Both the Main Layout Grid and Content Grid reponsively resize according to device screen width.
"; $vhtml .= "The default device breakpoints are 320px, 480px, 640px, 768px, 960px, 1140px and 1200px.
"; $vhtml .= "You can change the number and value of these breakpoints via the theme options screen.
"; $vhtml .= "(Note that any breakpoint larger than the maximum layout width set will be ignored.)
"; $vhtml .= "

Content Grid Syntax

"; $vhtml .= "Rather than using shortcodes, content columns can be generated using simple <div> element classes.
"; $vhtml .= '
';
	$vhtml .= '<div class="container"><div class="eight columns">COLUMN A</div>
'; $vhtml .= '<div class="eight columns">COLUMN B</div></div>

'; $vhtml .= '
COLUMN A
COLUMN B
'; $vhtml .= "
Using outside margins for columns is problematic because it is unknown how many columns may be in a row.
"; $vhtml .= "To resolve this problem, inner divs are used in each column to give inner padding instead of outside margins.
"; $vhtml .= "Simply add a second div inside the column div with a class of inner to achieve the spacing effect.
"; $vhtml .= "The grid stylesheet automatically applies the padding to the inner div to give the column spacing. eg.
"; $vhtml .= '
';
	$vhtml .= '<div class="container"><div class="eight columns"><div class="inner">COLUMN A</div></div>
'; $vhtml .= '<div class="eight columns"><div class="inner">COLUMN B</div></div></div>

'; $vhtml .= '
COLUMN A
'; $vhtml .= '
COLUMN B
'; $vhtml .= "
You can see the combination of resizable responsive grid with inner padding in the following example grid.
"; $vhtml .= "(some colours and borders styles are added here for clearer emphasis only.)
"; $vexample = '
1
11

2
10

3
9

4
8

5
7

6
6

7
5

8
4

9
3

10
2

11
1


'; $vhtml .= $vexample; $vhtml .= "

Content Grid Class Reference

"; $vhtml .= "Extra classes are available for column shifts and offsets, to help you position the grid columns.
"; $vhtml .= "Outer margins of different column sizes are applied to achieve these column shifts and offsets.
"; $vhtml .= "The below reference table shows you which of the numbered class names have what effect.
"; $vhtml .= '
BioShip
Framework
Skeleton
Boilerplate
960 Grid SystemBlueprintFoundation
Grid Columns12/16/20/241612 or 162412
Units%pxpxpx%
Container.container.container.container_12
.container_16
.container.row
Grid Column.{xxx}.columns
or .spanX
.{xxx}.columns
or .spanX
.grid_X.span-X.small-X.column
.medium-X.column
.large-X.column
Offset Left.offsetX or
.offsetleftX
(margin-left)
.offsetX
(padding-left)
.prefix_X
(padding-left)
.prepend-X
(padding-left)
.small-offset-X
.medium-offset-X
.large-offset-X
(margin-left)
Offset Right.offsetrightX
(margin-right)
n/a.suffix_X
(padding-right
.append-X
(padding-right)
n/a
Pull.shiftleftX
(-margin-left)
n/a.pull_X
(-left)
.pull-X
(-margin-left)
.pull-X,.small-pull-X
.medium-pull-X,.large-pull-X
(right)
Push.shiftrightX
(-margin-right)
n/a.push_X
(left)
.push-X
(margins)
.push-X,.small-push-X
.medium-push-X,.large-push-X
(left)
'; // extra ref: https://scotch.io/tutorials/cheat-sheet-for-comparing-bootstrap-and-foundation-css-classes // TODO: using smaller spacer columns // $vhtml .= "
Spacer Columns
"; $vhtml .= "
Content Grid Compatibility Classes
"; $vhtml .= "If you prefer, you can use the grid class syntax for 960GS or Blueprint classes by enabling
"; $vhtml .= "either of those options in theme settings so the rules are added to the grid stylesheet also.
"; $vhtml .= "For Foundation grid, simply enable the Foundation resources separately in theme settings tab
"; $vhtml .= "for Foundation (Skeleton layer), and use that grid syntax as you normally would.
"; if ($vwrap) {$vhtml .= "
"; $vhtml .= bioship_docs_wrap_close();} return $vhtml; } // ------------ // LAYOUT HOOKS // ------------ function bioship_docs_layout_hooks($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Layout Hooks


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} if ($vwrap) { // include the Hooks file for standalone docs $vhookfile = dirname(dirname(__FILE__)).'/hooks.php'; if (!file_exists($vhookfile)) { $vhtml .= "Error: Layout Hooks file was not found!?"; $vhtml .= ""; echo $vhtml; return; } if (!function_exists('__')) {function __($s, $d = 'bioship', $a = 'bioship') {return $s;} } include($vhookfile); } global $vthemehooks; // TODO: add Page Elements for Styling Reference? $vhtml .= ""; $vhtml .= ""; $vhtml .= ""; foreach ($vthemehooks['sections'] as $vsectionid => $vsectionhooks) { $vhtml .= ""; $vhtml .= "'; foreach ($vsectionhooks as $vsectionhook) { $vhtml .= ""; $vhtml .= ""; $vhookfunctions = $vthemehooks['functions'][$vsectionhook]; if (count($vhookfunctions) > 0) { $vthesefunctions = array(); $vthesepriorities = array(); foreach ($vhookfunctions as $vfunction => $vpriority) { $vthesefunctions[] = $vfunction; $vthesepriorities[] = $vpriority; } $vfunctiondisplay = implode('
',$vthesefunctions); $vprioritydisplay = implode('
',$vthesepriorities); $vhtml .= ""; $vhtml .= ""; } $vhtml .= ""; } } $vhtml .= "
Section / Hook LabelHook NameHooked FunctionsPriority
".$vthemehooks['labels'][$vsectionid].'
".$vthemehooks['labels'][$vsectionhook]."".$vsectionhook."".$vfunctiondisplay."".$vprioritydisplay."
"; $vhtml .= "

Hybrid Hook

"; $vhtml .= "All hooks are automatically made available to the Hybrid Hook plugin (modified for BioShip.)
"; $vhtml .= "When activated (via Theme Options -> Skeleton -> Hybrid) you can access Appearance -> Hybrid Hook.
"; $vhtml .= "This allows you to easily add content (Text, HTML, or Shortcode) to any of the Layout Hook sections.
"; $vhtml .= "(You can also specify a priority if you need to insert between existing hooked functions.)

"; $vhtml .= "

Manually Adding Functions

"; $vhtml .= "You can of course simply add your own functions to any of the available hooks with a few lines of code, in the form:
"; $vhtml .= "
add_action('{hook_name}', '{function_name}', {priority});
"; $vhtml .= "For example, to add a simple welcome message:"; $vhtml .= "
add_action('bioship_after_header', 'custom_after_header_function', 5);
"; $vhtml .= "function custom_after_header_function() {echo 'Welcome!';}
"; $vhtml .= "Or for an existing shortcode function called welcome_shortcode:"; $vhtml .= "
add_action('bioship_after_header', 'custom_welcome_shortcode', 5);
"; $vhtml .= "function custom_welcome_shortcode() {echo do_shortcode('[welcome_shortcode']);}

"; $vhtml .= "

Reordering Layout Functions

"; $vhtml .= "If something is hooked in the wrong position for your desired layout, you can change it's position with a filter.
"; $vhtml .= "Priority filters have the same name as the function appended with _position:"; $vhtml .= "
add_filter('bioship_header_widgets_position', 'custom_header_widgets_position');
"; $vhtml .= "function custom_header_widgets_position() {return 2;}

"; $vhtml .= "OR more directly with an anonymous function:"; $vhtml .= "
add_filter('bioship_header_widgets_position', function(){return 2;} );

"; $vhtml .= "

Removing Layout Functions

"; $vhtml .= "If you change the hooked function priority via filter to -1 and it will not be added. eg."; $vhtml .= "
add_filter('bioship_header_widgets_position', function(){return -1;} );

"; $vhtml .= "You can also remove any of the hooked functions you can do so using bioship_remove_action
"; $vhtml .= "This is a wrapper for WordPress remove_action with the filtered priority calculated automatically.
"; $vhtml .= "
bioship_remove_action('bioship_header', 'bioship_header_widgets');

"; $vhtml .= "Note: while you can do the same manually without using bioship_remove_action you would need to
"; $vhtml .= "delay the removal until after the action has been added or it will not actually be removed.
"; $vhtml .= "Practically speaking, this means wrapping in a further check in your functions.php eg.
"; $vhtml .= "
add_action('init', 'custom_layout_femovals');
"; $vhtml .= "function custom_layout_removals() {
"; $vhtml .= " remove_action('bioship_header', 'bioship_header_widgets', 6);
"; $vhtml .= "}
"; $vhtml .= "

Replacing Layout Functions

"; $vhtml .= "If something is hooked in the wrong section for your desired layout, you can remove it and reinsert it.
"; $vhtml .= "Note again you would need to delay the removal or use bioship_remove_action which auto-delays for you.
"; $vhtml .= "
bioship_remove_action('bioship_header', 'bioship_header_widgets');
"; $vhtml .= "add_action('bioship_navbar', 'bioship_header_widgets', 2);
"; $vhtml .= "

Header / Footer Extra HTML

"; $vhtml .= "You can also add extra HTML to the Header / Footer HTML sections using filters.
"; $vhtml .= "These are throwbacks from a previous implementation but are still available for use.
"; $vhtml .= "Filters: bioship_header_html_extras and bioship_footer_html_extras, eg:
"; $vhtml .= "
add_filter('bioship_header_html_extra', 'custom_header_html_extras');
"; $vhtml .= "function custom_header_html_extras() {return '<div>Div Content</div>';}
"; // TODO: finish banner position notes // $vhtml .= "

Banner Positions

"; // $vhtml .= "You can also add banners to the banner positions with the filter: skeleton_{position}_banner
"; // $vhtml .= "Available banner positions:
"; // $vhtml .= ""; // $vhtml .= ""; // $vhtml .= ""; // $vhtml .= ""; // $vhtml .= "
topskeleton_top_bannerabove main header area
headerskeleton_header_bannerbelow main header area (before navbar)
navbarskeleton_navbar_bannerafter navbar (before sidebars/content)
footerskeleton_footer_bannerabove main footer area
bottomskeleton_bottom_bannerbelow main footer area
"; // $vhtml .= "eg..."; // $vhtml .= "You can also add a banner image and link to any of these positions for an individual post.
"; // $vhtml .= "Just add a custom field with keys of {position}bannerurl and {position}bannerlink
"; // $vhtml .= "eg..."; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // =========== // DEVELOPMENT // =========== // ------------ // THEME VALUES // ------------ function bioship_docs_theme_values($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Theme Values


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= "

Theme Constants

"; $vhtml .= "
Theme ValuesDescriptionValue
THEMESLUGsanitized lowercase and hyphenated) theme namestring
THEMEKEYoptions table key value for theme optionsstring
THEMEDISPLAYNAMEthe Display Name of currently active Themestring
THEMEHOMEURLstatic URL of the BioShip website".THEMEHOMEURL."
THEMESUPPORTstatic URL of Support website (WordQuest)".THEMESUPPORT."
Load States
THEMESSLwhether to load SSL resources (is_ssl)true/false
THEMECHILDif using a Child Theme or nottrue/false
THEMEPARENTparent Theme template slug (if any)string
THEMEVERSIONcurrent version of BioShip Theme Frameworkx.x.x
THEMECHILDVERSIONChild Theme version (or parent if no child)x.x.x
Library States
THEMETITANif Titan Framework is loadedtrue/false
THEMEOPTif Options Framework is loadedtrue/false
THEMEHYBRIDif full Hybrid Core is loadedtrue/false
THEMEDRIVEif a Theme Test Drive is activetrue/false
THEMEKIRKIif Kirki is loaded (Customizer only)true/false
Theme Debugging
THEMEDEBUGoutput debugging information commentstrue/false
THEMECOMMENTSoutput template element commentstrue/false
THEMETRACEif performing a theme argument tracetrue/false
THEMEWINDOWSlocal environment for directory pathstrue/false

Theme Globals

Theme Options
\$vthemesettingsAll Current Theme SettingsMulti-level Array
\$vthemeoptionsAll Available Theme OptionsMulti-level Array
Theme Root Directories(with trailing slashes)Child ThemeNo Child Theme
\$vthemestyledirTheme Stylesheet DirectoryChild Theme DirParent Theme Dir
\$vthemestyleurlTheme Stylesheet URLChild Theme URLParent Theme URL
\$vthemetemplatedirTheme Template DirectoryParent Theme DirParent Theme Dir
\$vthemetemplateurlTheme Template URLParent Theme URLParent Theme URL
Theme Resource Directories
\$vthemedirsFile Hierarchy SearchDefault ValuesFilter
['core']Core Theme Directories Arrayempty array (theme root)skeleton_core_dirs
['admin']Theme Admin Directories Array'admin'skeleton_admin_dirs
['css']Style Directories Array'styles', 'css', 'assets/css'skeleton_css_dirs
['js']Script Directories Array'javascripts', 'js', 'assets/js'skeleton_js_dirs
['img']Image Directories Array'images', 'img', 'icons', 'assets/img'skeleton_img_dirs
Layout Sections and Hooks
\$vthemehooksLayout Hooks InformationNotes
['sections']Ordered array of Layout Sectionsnumeric key sections with hooks
['hooks']Array of Theme Layout Hook Keysflat list of all layout hook keys
['functions']Array of Hooked Default Functions(default function priorities are also stored)
['labels']Labels for both Sections and Hooks(sections numeric keys, hooks string keys)
['hybrid']Modified Layout Hook array for Hybrid Hook(bioship_ prefix removed)
Theme Layout Values
\$vthemelayoutCalculated (and Filtered) Theme LayoutFilter
['pagecontext']Page Context
['subpagecontext']Archive SubContext
['maxwidth']Maximum Layout Width (px)skeleton_layout_width
['gridcolumns']Word-Number of Grid Columnsskeleton_grid_columns
['contentcolumns']Word-Number of Content Columnsskeleton_content_columns_override
['rawcontentwidth']Content Width (px) - padding width not removedskeleton_raw_content_width
['contentwidth']Calculated Content Width (px)skeleton_content_width
['rawcontentpadding']Content Padding (CSS from Theme Option)skeleton_raw_content_padding
['contentpadding']Calculated Content Padding Width (px)skeleton_content_padding_width
['contentgridcolumns']Columns for Content Grid Systemskeleton_content_grid_columns
Sidebar Layout Values
\$vthemesidebarsCalculated (and Filtered) Sidebar LayoutFilter
['sidebars']Sidebar Template Layout Array* skeleton_sidebar_layout_override
['sidebar']Calculated Sidebar switch (true/false)
['subsidebar']Calculated SubSidebar switch (true/false)
['sidebarmode']Posts/Pages Sidebar Modeskeleton_sidebar_mode
['subsidebarmode']Posts/Pages SubSidebar Modeskeleton_subsidebar_mode
['sidebarcontext']Based on Page Context and Active Sidebars
['subsidebarcontext']Based on Page Context and Active Sidebars
['sidebarcolumns']Number-Word of Sidebar Columnsskeleton_sidebar_columns
['subsidebarcolumns']Number-Word of SubSidebar Columnsskeleton_subsidebar_columns
['output']Stores actual Sidebar content HTML for output
"; $vhtml .= "For more details on Sidebars see the BioShip Sidebar Guide.
"; // TODO: vthemedisplay and vthemeoverride globals if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } // --------- // DEBUGGING // --------- function bioship_docs_debug_guide($vwrap) { if ($vwrap) {$vdoclinks = bioship_docs_links(true); $vhtml = bioship_docs_wrap_open().'

BioShip Theme Debugging


';} else {$vhtml = ''; $vdoclinks = bioship_docs_links(false);} $vhtml .= "

HTML Page Element Comments

"; $vhtml .= "The THEMECOMMENTS constant is set by the theme according the option in Theme Options -> Skin -> Styles
"; $vhtml .= "This will wrap all the main Page Elements in HTML comments indicating start and finish of the element. eg.
"; $vhtml .= "
<!-- #sidebar -->{Sidebar Output}<!-- /#sidebar -->
"; $vhtml .= "This helps make things easier to find when viewing the page source or in a browser debug console. :-)
"; $vhtml .= "Of course it adds unnecessary length to the page size so you will want to turn this off in production.
"; $vhtml .= "[Value Filter] skeleton_html_comments - return true/false]
"; $vhtml .= "

Theme Debug Modes

"; $vhtml .= "Theme debug mode sets the THEMEDEBUG constant via the themedebug querystring switch (from any site URL.)
"; $vhtml .= "You can change switch the debug mode on or off, or set it to temporarily output (for that particular page load.)

"; $vhtml .= "In practice, you would usually just use ?themedebug=2 or ?themedebug=yes for a specific pageload.
"; $vhtml .= "However, to be able to test logged out user content you would need to switch debug mode ON and logout -
"; $vhtml .= "or simply view the logged out content from another browser with debug ON and then switch it OFF when done.

"; $vhtml .= "Note: You need edit_theme_options capability to toggle or enable/disable debug mode.
"; $vhtml .= "
"; $vhtml .= ""; $vhtml .= ""; $vhtml .= ""; $vhtml .= ""; $vhtml .= ""; $vhtml .= ""; $vhtml .= "
QuerystringAlternativeDebug Action
?themedebug=0?themedebug=offswitch theme debug mode off (persistant)
?themedebug=1?themedebug=onswitch theme debug mode on (persistant)
?themedebug=2?themedebug=yesdebug mode on for this pageload (overrides switch)
?themedebug=3?themedebug=nodebug mode off for this pageload (overrides switch)
[Value Filter]skeleton_theme_debugreturn true/false
"; $vhtml .= "
When active you debug information will be output to the HTML page source wrapped in HTML comment tags.
"; $vhtml .= "Each debug info occurrence will appear in the form of:
"; $vhtml .= "
<!-- Debug Info Description: {INFO} -->
"; $vhtml .= "This is so you can search the theme source for a particular 'Info Description' to see what is happening.

"; $vhtml .= "Warning: this kind of debug output can prevent Theme Settings or other admin/form/AJAX methods from saving!
"; $vhtml .= "This is because echoing this information inline means headers are already sent and thus can prevent redirects -
"; $vhtml .= "causing the Settings API and other things to fail. :-/ So always remember to turn theme debug mode off!
"; // $vhtml .= "

Theme Debug to File

"; // TODO: better debug to file options and explanation $vhtml .= "

Included Page Templates

"; $vhtml .= "You can easily see what page templates are being included on a page (useful for WooCommerce/Forum templates etc.)
"; $vhtml .= "Simply search for 'Included Template Files' (Debug Info Description) in the page source when debug mode is active.
"; $vhtml .= "You will find a list of all files included between the wp_loaded and wp_footer action hooks in the page footer.
"; // $vhtml .= "

Theme Debug Tracer

"; // $vhtml .= "A Theme Function Tracer has been developed for theme template, function, and function argument tracing.
"; // $vhtml .= "This allows you to see the flow of all template and function calls parsed by the theme as it runs.
"; // $vhtml .= "By default trace information is output to your themes /debug/ directory (relative to parent or child.)
"; // $vhtml .= "Note: you need the user manage_options capability to do a theme function trace.

"; // TODO: table display for these querystring options // $vhtml .= "?themetrace=1 or ?themetrace=yes"; // $vhtml .= "&trace=resourcetype"; // functions, templates, filters, all // $vhtml .= "&tracecalls=1 or &tracecalls=yes"; // $vhtml .= "&traceargs=1 or &traceargs=yes"; // $vhtml .= "&tracedisplay=1 or &tracedisplay=yes"; // $vhtml .= "&tracefunc=functionname"; // $vhtml .= "&tracefilter=filtername"; // $vhtml .= "&instance=instanceid"; // $vhtml .= "

Heavy Debugging

"; // $vhtml .= "Of course, you can always use good old:
var_dump(debug_backtrace());
in your code somewhere.
"; // $vhtml .= "Typically this gives you a massive amount of information you don't need so an above method is preferred.
"; if ($vwrap) {$vhtml .= bioship_docs_wrap_close();} return $vhtml; } ?>