';
endif;
endif;
if( !empty( $nav ) ) { // do not show empty markup
$nav = "\n".' '."\n";
}
return $nav;
}
endif; // activetab_nav()
if ( ! function_exists( 'activetab_excerpt_more' ) ) :
function activetab_excerpt_more( $more ) { // "more-link" is bad for seo and for usability - http://web-profile.com.ua/web/web-principles/more-link/
return '...';
}
add_filter('excerpt_more', 'activetab_excerpt_more');
endif; // activetab_excerpt_more()
if ( ! function_exists( 'activetab_is_homepage' ) ) :
function activetab_is_homepage() {
global $paged;
// if( is_home() || is_front_page() ){} // simple way
$show_on_front = get_option( 'show_on_front' ); // page or posts
$page_on_front = get_option( 'page_on_front' ); // 0 or page_id
$page_for_posts = get_option( 'page_for_posts' ); // 0 or page_id
if ( ( $show_on_front == 'page' ) || ( $page_on_front != 0 ) ){
if( is_front_page() ){
return true;
}
} elseif ( ( $show_on_front == 'posts' ) || ( $page_for_posts == 0 ) ) {
if( is_home() && $paged < 2 ) { // show link to homepage from paged pages
return true;
}
} else {
return false;
}
}
endif; // activetab_is_homepage()
// ========== options framework ==========
/*
* Loads the Options Panel
*
* If you're loading from a child theme use stylesheet_directory
* instead of template_directory
*/
if ( ! function_exists( 'optionsframework_init' ) ) {
define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/options-framework/' );
require_once dirname( __FILE__ ) . '/options-framework/options-framework.php';
}
/**
* A unique identifier is defined to store the options in the database and reference them from the theme.
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
* If the identifier changes, it'll appear as if the options have been reset.
*/
function optionsframework_option_name() { // set theme option name to 'activetab_options' and save all options there
// This gets the theme name from the stylesheet
$themename = wp_get_theme();
$themename = preg_replace( "/\W/", "_", strtolower( $themename ) );
$optionsframework_settings = get_option( 'optionsframework' );
$optionsframework_settings['id'] = $themename . '_options';
update_option( 'optionsframework', $optionsframework_settings );
}