'.PHP_EOL.PHP_EOL;
}
}
// Main Wrapper Close
// ------------------
if (!function_exists('bioship_skeleton_wrapper_close')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_container_close', 'bioship_skeleton_wrapper_close', 5);
function bioship_skeleton_wrapper_close() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
echo '
'.PHP_EOL;
bioship_html_comment('/#wrap.container');
echo PHP_EOL;
}
}
// Echo a Clearing Div
// -------------------
// 1.5.0: moved clear div here for flexibility
if (!function_exists('bioship_skeleton_echo_clear_div')) {
function bioship_skeleton_echo_clear_div() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
echo ''.PHP_EOL;
}
}
// Add Clear Divs to Various Layout Points
// ---------------------------------------
// 1.9.8: use bioship_add_action to make positions filterable
// note: use "hook_function_position" combination as filter name to change these positions
// eg. add_filter('bioship_navbar_bioship_echo_clear_div_position', function(){return 4;} );
// after header nav
bioship_add_action('bioship_header', 'bioship_skeleton_echo_clear_div', 3);
// after nav menu // 1.8.0: moved sidebar buttons inline
// add_action('bioship_navbar','skeleton_echo_clear_div',6);
// after nav bar
bioship_add_action('bioship_after_navbar', 'bioship_skeleton_echo_clear_div', 0);
bioship_add_action('bioship_after_navbar', 'bioship_skeleton_echo_clear_div', 8);
// 1.9.8: after content
bioship_add_action('bioship_after_content', 'bioship_skeleton_echo_clear_div', 2);
// before footer
bioship_add_action('bioship_before_footer', 'bioship_skeleton_echo_clear_div', 10);
// after footer widgets
bioship_add_action('bioship_footer', 'bioship_skeleton_echo_clear_div', 5);
// after footer nav
bioship_add_action('bioship_footer', 'bioship_skeleton_echo_clear_div', 7);
// --------------
// === Header ===
// --------------
// Header Action Hooks
// -------------------
// bioship_skeleton_header_open: 0
// bioship_skeleton_header_nav: 2
// bioship_skeleton_header_logo: 4
// bioship_skeleton_header_widgets: 6
// bioship_skeleton_header_extras: 8
// bioship_skeleton_header_close: 10
// Header Wrap Open
// ----------------
if (!function_exists('bioship_skeleton_header_open')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_header', 'bioship_skeleton_header_open', 0);
function bioship_skeleton_header_open() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthemesettings, $vthemelayout;
// 1.5.0: added header class compatibility and filter
// 1.8.0: added alpha and omega classes to header div
// 1.8.5: use new theme layout global
// 1.9.0: removed 960gs classes from theme grid (now for content grid only)
$vclasses = array(); $vclasses[] = $vthemelayout['gridcolumns'];
$vclasses[] = 'columns'; $vclasses[] = 'alpha'; $vclasses[] = 'omega';
$vclasses = bioship_apply_filters('skeleton_header_classes', $vclasses);
$vheaderclasses = implode(' ',$vclasses);
bioship_html_comment('#header');
$vattributes = hybrid_get_attr('header');
echo '
'.PHP_EOL;
bioship_html_comment('/#header');
echo PHP_EOL;
}
}
// Header Nav Menu
// ---------------
if (!function_exists('bioship_skeleton_header_nav')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_header' ,'bioship_skeleton_header_nav', 2);
function bioship_skeleton_header_nav() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthememenus; if (!$vthememenus['header']) {return;}
// note: can use Hybrid attribute filter to add column classes
bioship_html_comment('.header-menu');
$vattributes = hybrid_get_attr('menu','header');
echo '
'.PHP_EOL;
bioship_html_comment('/.header-menu');
echo PHP_EOL;
}
}
// Skeleton Header Logo
// --------------------
if (!function_exists('bioship_skeleton_header_logo')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_header', 'bioship_skeleton_header_logo', 4);
function bioship_skeleton_header_logo() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthemesettings, $vthemedisplay;
$vlogourl = $vthemesettings['header_logo'];
// 1.5.0: moved logo url filter
$vlogourl = bioship_apply_filters('skeleton_header_logo_url', $vlogourl);
// 1.8.5: use home_url not site_url
$vhomeurl = esc_url(home_url('/'));
// 2.0.6: added site logo and home title link filters
$vhomeurl = bioship_apply_filters('skeleton_title_link_url', $vhomeurl);
$vlogolinkurl = bioship_apply_filters('skeleton_logo_link_url', $vhomeurl);
$vblogname = get_bloginfo('name','display');
$vblogname = bioship_apply_filters('skeleton_blog_display_name', $vblogname);
$vblogdescription = get_bloginfo('description');
$vblogdescription = bioship_apply_filters('skeleton_blog_description', $vblogdescription);
// 1.8.0: added header logo class filter
$vlogoclasses = bioship_apply_filters('skeleton_header_logo_classes', 'logo');
// 1.8.5: recombined image/text template for live previewing
// 1.8.5: added site text / description text display checkboxes
// 1.9.0: fix to logo logic here having separated text display
// 2.0.6: display as inline block (for combine logo and site title)
// 2.0.7: move inline-block display to style.css for easier overriding
$vlogoimagedisplay = ' style="display:none;"';
if ($vlogourl) {$vlogoimagedisplay = '';}
$vsitetitle = false; $vsitedesc = false;
if ( (isset($vthemesettings['header_texts']['sitetitle']))
&& ($vthemesettings['header_texts']['sitetitle'] == '1') ) {$vsitetitle = true;}
if ( (isset($vthemesettings['header_texts']['sitedescription']))
&& ($vthemesettings['header_texts']['sitedescription'] == '1') ) {$vsitedesc = true;}
// TODO: add/check perpost meta display overrides?
// if ($vthemedisplay['sitetitle'] == '') {}
// if ($vthemedisplay['sitedesc'] == '') {}
$vsitetitle = bioship_apply_filters('skeleton_site_title_display', $vsitetitle);
$vsitedesc = bioship_apply_filters('skeleton_site_description_display', $vsitedesc);
// 1.9.9: separate display variables for site title and description
$vsitetitledisplay = ''; $vsitedescdisplay = '';
if (!$vsitetitle) {$vsitetitledisplay = ' style="display:none;"';}
if (!$vsitedesc) {$vsitedescdisplay = ' style="display:none;"';}
// 1.8.5: fix to hybrid attributes names (_ to -)
// 1.9.0: added filter to site-description attribute to prevent duplicate ID
// 1.9.6: added logo-image ID not just class
// 2.0.6: display inline-block for site-logo-text (for combined display)
// 2.0.7: move inline block to style.css for easier overriding
$vlogo = '';
if (THEMECOMMENTS) {$vlogo .= '';}
$vlogo .= '
'.PHP_EOL;
if (THEMECOMMENTS) {$vlogo .= ''.PHP_EOL;}
$vlogo .= PHP_EOL;
$vlogo = bioship_apply_filters('skeleton_header_logo_override', $vlogo);
echo $vlogo;
}
}
// Header Widgets
// --------------
if (!function_exists('bioship_skeleton_header_widgets')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_header', 'bioship_skeleton_header_widgets', 6);
function bioship_skeleton_header_widgets() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
// note: template filterable to allow for custom post types (see filters.php)
// default template is sidebar/header.php
$vheader = bioship_apply_filters('skeleton_header_sidebar', 'header');
hybrid_get_sidebar($vheader);
}
}
// Header Extras
// -------------
if (!function_exists('bioship_skeleton_header_extras')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_header', 'bioship_skeleton_header_extras', 8);
function bioship_skeleton_header_extras() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthemesettings;
// 2.0.0: allow for use of shorter header extras filter name
$vheaderextras = bioship_apply_filters('skeleton_header_extras', '');
$vheaderextras = bioship_apply_filters('skeleton_header_html_extras', $vheaderextras);
if ($vheaderextras) {
// 1.8.0: changed #header_extras to #header-extras for consistency, added class filter
$vheaderextraclasses = bioship_apply_filters('skeleton_header_extras_classes', 'header-extras');
bioship_html_comment('#header-extras');
echo '
'.PHP_EOL;
echo '
'.PHP_EOL;
echo $vheaderextras.PHP_EOL;
echo '
'.PHP_EOL;
echo '
';
bioship_html_comment('/#header-extras');
echo PHP_EOL;
}
}
}
// -----------------
// === Nav Menus ===
// -----------------
// Main Menu Wrap Open
// -------------------
if (!function_exists('bioship_skeleton_main_menu_open')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_navbar', 'bioship_skeleton_main_menu_open', 0);
function bioship_skeleton_main_menu_open() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthememenus; if (!$vthememenus['primary']) {return;}
// note: can filter classes using Hybrid attribute filter
bioship_html_comment('#navigation');
$vattributes = hybrid_get_attr('menu', 'primary');
echo '
'.PHP_EOL.PHP_EOL;
}
}
// Primary Navigation Menu
// -----------------------
if (!function_exists('bioship_skeleton_main_menu')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_navbar', 'bioship_skeleton_main_menu', 8);
function bioship_skeleton_main_menu() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthememenus; if (!$vthememenus['primary']) {return;}
// 1.9.9: check hide navigation override filter
$vhidenav = bioship_apply_filters('skeleton_navigation_hide', 0);
if ($vhidenav) {return;}
// 1.8.0: only output if there is a menu is assigned
// 2.0.5: moved has_nav_menu check to register_nav_menus
$vmenuargs = array(
'container_id' => 'mainmenu',
'container_class' => 'menu-header',
'theme_location' => 'primary'
);
$vmenuargs = bioship_apply_filters('skeleton_primary_menu_settings', $vmenuargs);
wp_nav_menu($vmenuargs);
}
}
// Wrap Close
// ----------
if (!function_exists('bioship_skeleton_main_menu_close')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_navbar', 'bioship_skeleton_main_menu_close', 10);
function bioship_skeleton_main_menu_close() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthememenus; if (!$vthememenus['primary']) {return;}
echo '
'.PHP_EOL;
bioship_html_comment('/#navigation');
echo PHP_EOL;
}
}
// Main Menu Mobile Button
// -----------------------
// 1.5.0: added mobile menu button
if (!function_exists('bioship_skeleton_main_menu_button')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_navbar', 'bioship_skeleton_main_menu_button', 4);
function bioship_skeleton_main_menu_button() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthememenus; if (!$vthememenus['primary']) {return;}
// 1.5.5: check for perpost navigation disable
// 1.9.8: fix to use display override global
// 1.9.9: check hide navigation override filter
// 2.0.5: moved has_nav_menu check to register_nav_menus
$vhidenav = bioship_apply_filters('skeleton_navigation_hide', 0);
if ($vhidenav) {return;}
echo '
';
}
}
// Secondary Menu
// --------------
// note: action 'skeleton_secondarynav' is not actually called anywhere
// this is an auxiliary navigation bar available for custom positioning
// ...or direct firing via: do_action('bioship_secondarynav');
if (!function_exists('bioship_skeleton_secondary_menu')) {
// 1.9.8: use new position filtered add_action method
// 1.9.8: hooked this to an existing template position (previously unused)
bioship_add_action('bioship_before_header', 'bioship_skeleton_secondary_menu', 8);
add_action('bioship_secondarynav', 'bioship_skeleton_secondary_menu');
function bioship_skeleton_secondary_menu() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthememenus; if (!$vthememenus['secondary']) {return;}
// 2.0.5: moved has_nav_menu check to register_nav_menus
$vattributes = hybrid_get_attr('menu', 'secondary');
bioship_html_comment('#secondarymenu');
echo '
'.PHP_EOL.PHP_EOL;
}
}
// Sidebar Wrap Close
// ------------------
if (!function_exists('skeleton_sidebar_close')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_after_sidebar', 'bioship_skeleton_sidebar_close', 5);
function bioship_skeleton_sidebar_close() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
echo PHP_EOL.'
'.PHP_EOL.PHP_EOL;
}
}
// Subsidebar Wrap Close
// ---------------------
// 1.8.0: fix from skeleton_subsidebar_wrap_close
if (!function_exists('bioship_skeleton_subsidebar_close')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_after_subsidebar', 'bioship_skeleton_subsidebar_close', 5);
function bioship_skeleton_subsidebar_close() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
echo PHP_EOL.'
'.PHP_EOL.PHP_EOL;
}
}
// Content Wrap Close
// ------------------
if (!function_exists('bioship_skeleton_content_close')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_after_content', 'bioship_skeleton_content_close', 0);
function bioship_skeleton_content_close() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
echo PHP_EOL.'
'.PHP_EOL;
bioship_html_comment('/#content');
echo PHP_EOL;
echo ''; // #bottom id for scroll links
}
}
// Home (Blog) Page Top Content
// ----------------------------
// 1.8.5: moved this here from loop-hybrid.php
// TODO: add filter examples to filters.php
if (!function_exists('bioship_skeleton_home_page_content')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_home_page_top','skeleton_home_page_content',5);
function bioship_skeleton_home_page_content() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
$vpageid = get_option('page_for_posts');
if ($vpageid) {
$vtitle = get_the_title($vpageid);
// 1.9.8: added new home page title filter
// TODO: add filter example to filters.php
$vtitle = bioship_apply_filters('skeleton_home_page_title', $vtitle);
if ($vtitle) {
bioship_html_comment('#blogpagetitle');
echo '
'.$vtitle.'
'.PHP_EOL;
bioship_html_comment('/#blogpagetitle');
echo PHP_EOL;
}
setup_postdata(get_page($vpageid));
ob_start(); the_content(); $vcontent = ob_get_contents(); ob_end_clean();
// 1.9.8: added new home page content filter
// TODO: add filter example to filters.php
$vcontent = apply_filters('skeleton_home_page_content', $vcontent);
if ($vcontent) {
bioship_html_comment('#blogpagecontent');
echo '
'.$vcontent.'
'.PHP_EOL;
bioship_html_comment('/#blogpagecontent');
}
}
}
}
// Echo the Excerpt via Action Hook
// --------------------------------
// 1.5.0: added for no reason but to make it overrideable
if (!function_exists('skeleton_echo_the_excerpt')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_the_excerpt', 'bioship_skeleton_echo_the_excerpt', 5);
function bioship_skeleton_echo_the_excerpt() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
the_excerpt();
}
}
// Ensure Body Content Not Output in Head
// --------------------------------------
// 2.0.5: avoid very weird bug (probably due to a plugin)
$vthemehead = false;
add_action('wp_head', 'bioship_head_finished', 999);
if (!function_exists('bioship_head_finished')) {
function bioship_head_finished() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
global $vthemehead; $vthemehead = true;
if (THEMEDEBUG) {echo "";}
}
}
// Echo the Content via Action Hook
// --------------------------------
// 1.5.0: added for no reason but to make it overrideable
if (!function_exists('bioship_skeleton_echo_the_content')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_the_content', 'bioship_skeleton_echo_the_content', 5);
function bioship_skeleton_echo_the_content() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
if (THEMEDEBUG) {
global $wp_filter;
// print_r(array_keys($wp_filter));
// ob_start(); print_r($wp_filter['wp_head']); $debug = ob_get_contents(); ob_end_clean();
// $file = dirname(__FILE__).'/debug/filters.txt';
// bioship_write_to_file($file, $debug);
print_r($wp_filter['the_content']);
}
global $vthemehead;
if ($vthemehead) {the_content();}
}
}
// Media Template Handler
// ----------------------
// 1.8.0: media handler for attachments and post formats
if (!function_exists('bioship_skeleton_media_handler')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_media_handler', 'bioship_skeleton_media_handler', 5);
function bioship_skeleton_media_handler() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
if (!is_singular()) {return;}
global $vthemesettings;
// Attachments
// -----------
if (is_attachment()) {
// check attachment mime type
$vmimetype = get_post_mime_type();
if (strstr($vmimetype,'audio')) {$vtype = 'audio';}
elseif (strstr($vmimetype,'video')) {$vtype = 'video';}
elseif (strstr($vmimetype,'image')) {$vtype = 'image';}
elseif (strstr($vmimetype,'text')) {$vtype = 'text';}
elseif (strstr($vmimetype,'application')) {$vtype = 'application';}
else {return;} // unrecognized
// Display Attachment
// ------------------
bioship_html_comment('#attachment');
echo '
'.PHP_EOL;
if (THEMECOMMENTS) {$vthumbnail .= ''.PHP_EOL;}
$vthumbnail .= PHP_EOL;
}
if (THEMEDEBUG) {echo "";}
$vthumbnail = bioship_apply_filters('skeleton_thumbnail_override', $vthumbnail);
return $vthumbnail;
}
}
// Skeleton Thumbnailer
// --------------------
// 1.3.0: no longer a Skeleton content filter
// 1.5.0: changed to more general classes and added method
if (!function_exists('bioship_skeleton_thumbnailer')) {
function bioship_skeleton_thumbnailer($vpostid, $vthumbsize, $vthumbclasses, $vmethod='') {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__,func_get_args());}
// $vclasses .= ' scale-with-grid'; // now by default in templates
if (has_post_thumbnail($vpostid)) {
// 1.5.0: added attachment method support for CPTs
if ($vmethod == 'attachment') {
$vattachmentid = get_post_thumbnail_id($vpostid);
if ($vattachmentid) {
// get the attachment image with alt attributes
// via wp_get_attachment_image codex example
$vattributes = array(
'class' => $vthumbclasses,
'alt' => trim(strip_tags(get_post_meta($vattachmentid, '_wp_attachment_image_alt', true)))
);
$vimage = wp_get_attachment_image($vattachmentid, $vthumbsize, false, $vattributes);
return $vimage;
}
}
// 2.0.5: simplified fallback
// simpler default method
$vimage = get_the_post_thumbnail($vpostid, $vthumbsize, array('class'=>$vthumbclasses));
return $vimage;
}
}
}
// ------------------
// === Author Bio ===
// ------------------
// Echo Author Bio Action
// ----------------------
// 1.9.8: abstracted for bottom and top
if (!function_exists('bioship_skeleton_echo_author_bio')) {
function bioship_skeleton_echo_author_bio($vposition) {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__,func_get_args());}
// 2.0.5: undefined variable warning fix
$vauthorbio = false;
if (is_author()) {$vauthorbio = bioship_skeleton_author_bio_box('archive', 'archive', $vposition);}
elseif (is_singular()) {
global $post; $vpostid = $post->ID; $vposttype = $post->post_type;
$vauthorbio = bioship_skeleton_author_bio_box($vpostid, $vposttype, $vposition);
}
if ($vauthorbio) {
bioship_do_action('bioship_before_author_bio');
bioship_locate_template(array('content/author-bio.php'), true);
bioship_do_action('bioship_after_author_bio');
}
}
}
// Echo Author Bio Action (Top)
// ---------------------------
// 1.9.8: abstracted call for top and bottom
if (!function_exists('bioship_skeleton_echo_author_bio_top')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_author_bio_top', 'bioship_skeleton_echo_author_bio_top', 5);
// 1.9.0: add author bio to author archive top?
// bioship_add_action('bioship_before_author', 'bioship_skeleton_echo_author_bio_top', 5);
function bioship_skeleton_echo_author_bio_top() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
bioship_skeleton_echo_author_bio('top');
}
}
// Echo Author Bio Action (Bottom)
// -------------------------------
// 1.9.8: abstracted call
if (!function_exists('bioship_skeleton_echo_author_bio_bottom')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_author_bio_bottom', 'bioship_skeleton_echo_author_bio_bottom', 5);
// 1.9.0: add author bio to author archive bottom?
// bioship_add_action('bioship_after_author', 'bioship_skeleton_echo_author_bio_bottom', 5);
function bioship_skeleton_echo_author_bio_bottom() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
bioship_skeleton_echo_author_bio('bottom');
}
}
// Author Bio Box
// --------------
// 1.5.0: separated from content template
// if author has a description, show a bio on their entries
if (!function_exists('bioship_skeleton_author_bio_box')) {
function bioship_skeleton_author_bio_box($vpostid, $vposttype, $vposition) {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__,func_get_args());}
global $vthemesettings, $vthemedisplay;
// author must have filled in their bio description
if (!get_the_author_meta('description')) {return false;}
if ( ($vpostid == 'archive') && ($vposttype == 'archive') ) {
// TODO: add archive option for author bio position
return false;
} else {
// check whether global show is on and filter
// 1.8.0: fix to showbox filter variable
$vshowbox = $vthemesettings['authorbiocpts'][$vposttype];
$vshowbox = bioship_apply_filters('skeleton_author_bio_box',$vshowbox);
if (!$vshowbox) {return false;}
// check the default position and filter
$vbiopos = $vthemesettings['authorbiopos'];
$vbiopos = bioship_apply_filters('skeleton_author_bio_box_position', $vbiopos);
if ( ($vposition == 'top') && (!strstr($vbiopos,'top')) ) {return false;}
if ( ($vposition == 'bottom') && (!strstr($vbiopos,'bottom')) ) {return false;}
// 1.9.9: removed old meta check
return true;
}
}
}
// About Author Text
// -----------------
// 1.5.0: moved from author-bio.php
if (!function_exists('bioship_skeleton_about_author_title')) {
function bioship_skeleton_about_author_title() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
// 1.8.0: use separately to get author display name
// 2.0.5: fix to typo (vauthordosplay) :-/
// 2.0.8: fix for non-singular display usage
if (is_singular()) {
global $post; $vauthordisplay = bioship_get_author_display_by_post($post->ID);
$vboxtitle = esc_attr(sprintf( __('About %s', 'bioship'), $vauthordisplay));
} else {$vboxtitle = __('About the Author','bioship');}
// 2.0.5: fix to fatal function typo (apply_filter)
$vboxtitle = bioship_apply_filters('skeleton_about_author_text', $vboxtitle);
return $vboxtitle; // .meta-prep-author ?
}
}
// About Author Description
// ------------------------
// 2.0.5: separated to add filter
// 2.0.8: fix to incorrect function prefix (missing _skeleton)
if (!function_exists('bioship_skeleton_about_author_description')) {
function bioship_skeleton_about_author_description() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
// 2.0.8: fix to get description outside the content loop
// 2.0.8: fix to singular post check for post object
$vpostid = false;
if (is_singular()) {global $post; $vpostid = $post->ID;}
$vauthor = bioship_get_author_by_post($vpostid);
if (!$vauthor) {return;}
$vauthordesc = get_the_author_meta('description', $vauthor->ID);
// TODO: add this filter to filters.php example list
$vauthordesc = bioship_apply_filters('skeleton_about_author_description', $vauthordesc);
return $vauthordesc;
}
}
// Author Posts Text
// -----------------
// 1.5.0: moved from author-bio.php
// 1.8.0: fix for missing author URL
if (!function_exists('bioship_skeleton_author_posts_link')) {
function bioship_skeleton_author_posts_link($vauthorurl=false) {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__,func_get_args());}
$vpostid = false; $vposttype = false;
if (is_singular()) {global $post; $vposttype = $post->post_type; $vpostid = $post->ID;}
// 2.0.8: fix for possible missing author URL (author-bio.php template)
$vauthor = bioship_get_author_by_post($vpostid);
if (!$vauthor) {return;}
if (!$vauthorurl) {$vauthorurl = get_author_posts_url($vauthor->ID);}
// 1.5.0: use post type display name
// 2.0.8: fix for possible
$vposttypedisplay = false;
if ($vposttype == 'page') {$vposttypedisplay = __('Pages','bioship');}
elseif ($vposttype == 'post') {$vposttypedisplay = __('Posts','bioship');}
elseif ($vposttype) {
// 1.8.0: use the plural name not the singular one
// $vposttypedisplay = $vposttypeobject->labels->singular_name;
$vposttypeobject = get_post_type_object($vposttype);
$vposttypedisplay = $vposttypeobject->labels->name;
} else {$vposttypedisplay = __('Writings','bioship');}
$vposttypedisplay = bioship_apply_filters('skeleton_post_type_display', $vposttypedisplay);
// 2.0.8: bug out if unable to get valid post type display label
if (!$vposttypedisplay) {return false;}
// 1.8.0: use separately to get author display name
// 2.0.8: bug out if unable to get valid author display name
$vauthordisplay = bioship_get_author_display($vauthor);
if (!$vauthordisplay) {return false;}
// 1.5.5: fix to translations here for theme check
$vanchor = sprintf( __('View all','bioship').' '.$vposttypedisplay.' '.__('by','bioship').' %s →', $vauthordisplay );
$vanchor = bioship_apply_filters('skeleton_author_posts_anchor', $vanchor);
if (!$vanchor) {return false;}
// 1.8.5: class attribute override fix
$vattributes = hybrid_get_attr('entry-author', '', array('class' => 'author vcard entry-author'));
$vauthorlink = ''.PHP_EOL;
$vauthorlink .= ' '.$vanchor.''.PHP_EOL;
$vauthorlink .= ''.PHP_EOL;
// 2.0.8: added override filter for author link HTML
$vauthorlink = bioship_apply_filters('skeleton_author_link_html', $vauthorlink);
return $vauthorlink;
}
}
// ----------------
// === Comments ===
// ----------------
// Echo Comments Action Hook
// -------------------------
if (!function_exists('bioship_skeleton_echo_comments')) {
// 1.9.8: use new position filtered add_action method
bioship_add_action('bioship_comments', 'bioship_skeleton_echo_comments', 5);
function bioship_skeleton_echo_comments() {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__);}
// note: comments template filter is located in functions.php
// 1.5.0: Loads the comments template (default /comments.php)
if ( (have_comments()) || (comments_open()) ) {
comments_template('/comments.php', true);
} else {
$vcommentsclosedtext = bioship_apply_filters('skeleton_comments_closed_text', '');
bioship_html_comment('.commentclosed');
echo '
'.$vcommentsclosedtext.'
';
bioship_html_comment('/.commentsclosed');
}
}
}
// Skeleton Comments Callback
// --------------------------
// wp_list_comments callback called in comments.php
if (!function_exists('bioship_skeleton_comments')) {
function bioship_skeleton_comments($comment, $args, $depth) {
if (THEMETRACE) {bioship_trace('F',__FUNCTION__,__FILE__,func_get_args());}
global $vthemesettings;
// 1.8.5: added comment edit/reply link buttons option
if ( (isset($vthemesettings['commentbuttons'])) && ($vthemesettings['commentbuttons'] == '1') ) {
$vcommentbuttons = ' button';} else {$vcommentbuttons = '';}
$GLOBALS['comment'] = $comment;
$vavatarsize = bioship_apply_filters('skeleton_comments_avatar_size', 48);
bioship_html_comment('li');
// TODO: maybe use Hybrid comment attributes?
// echo '
'.PHP_EOL;
echo '
'.PHP_EOL;
echo '
';
echo '
'.get_avatar($comment,$vavatarsize).'
';
echo '
';
if ($comment->comment_approved == '0') {
echo ''.__('Comment is awaiting moderation','bioship').' ';
}
// 1.8.5: added 'on' and 'at' to string
echo ''.__('by','bioship').' '.get_comment_author_link().'';
echo ' '.__('on','bioship').' '.get_comment_date().' '.__('at','bioship').' '.get_comment_time().'';
echo '
'; } // 1.8.5: added 'on' and 'at' to string echo ''.__('by','bioship').' '.get_comment_author_link().''; echo '
'.__('on','bioship').' '.get_comment_date().' '.__('at','bioship').' '.get_comment_time().''; echo '