= 2 || $page >= 2 ) $title = "$title $sep " . sprintf( __( 'Page %s', 'simplecatch' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'simplecatch_wp_title', 10, 2 ); /** * Sets the post excerpt length to 30 words. * * function tied to the excerpt_length filter hook. * @uses filter excerpt_length */ function simplecatch_excerpt_length( $length ) { global $simplecatch_options_settings; $options = $simplecatch_options_settings; return $options[ 'excerpt_length' ]; } add_filter( 'excerpt_length', 'simplecatch_excerpt_length' ); /** * Returns a "Continue Reading" link for excerpts */ function simplecatch_continue_reading() { global $simplecatch_options_settings; $options = $simplecatch_options_settings; $more_tag_text = $options[ 'more_tag_text' ]; return ' ' . sprintf( __( '%s', 'simplecatch' ), esc_attr( $more_tag_text ) ) . ''; } /** * Replaces "[...]" (appended to automatically generated excerpts) with simplecatch_continue_reading(). * */ function simplecatch_excerpt_more( $more ) { return ' …' . simplecatch_continue_reading(); } add_filter( 'excerpt_more', 'simplecatch_excerpt_more' ); /** * Adds Continue Reading link to post excerpts. * * function tied to the get_the_excerpt filter hook. */ function simplecatch_custom_excerpt( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= simplecatch_continue_reading(); } return $output; } add_filter( 'get_the_excerpt', 'simplecatch_custom_excerpt' ); if ( ! function_exists( 'simplecatch_headerdetails' ) ) : /** * Get the header logo Image from theme options * * @uses header logo * @get the data value of image from theme options * @display Header Image logo * * @uses default logo if logo field on theme options is empty * * @uses set_transient and delete_transient */ function simplecatch_headerdetails() { //delete_transient( 'simplecatch_headerdetails' ); global $simplecatch_options_settings; $options = $simplecatch_options_settings; if ( ( !$simplecatch_headerdetails = get_transient( 'simplecatch_headerdetails' ) ) && ( !empty( $options[ 'featured_logo_header' ] ) || empty( $options[ 'remove_site_title' ] ) || empty( $options[ 'remove_site_description' ] ) ) ) { echo ''; $simplecatch_headerdetails = '
';
endif;
endif;
set_transient( 'simplecatch_footerlogo', $simplecatch_footerlogo, 86940 );
}
echo $simplecatch_footerlogo;
}
endif; // simplecatch_footerlogo
/**
* Get the favicon Image from theme options
*
* @uses favicon
* @get the data value of image from theme options
* @display favicon
*
* @uses default favicon if favicon field on theme options is empty
*
* @uses set_transient and delete_transient
*/
function simplecatch_favicon() {
//delete_transient( 'simplecatch_favicon' );
if( ( !$simplecatch_favicon = get_transient( 'simplecatch_favicon' ) ) ) {
global $simplecatch_options_settings;
$options = $simplecatch_options_settings;
echo '';
// if not empty fav_icon on theme options
if ( empty( $options[ 'remove_fav_icon' ] ) ) :
// if not empty fav_icon on theme options
if ( !empty( $options[ 'fav_icon' ] ) ) :
$simplecatch_favicon = '';
else:
// if empty featured_logo_footer on theme options, display default fav icon
$simplecatch_favicon ='';
endif;
endif;
set_transient( 'simplecatch_favicon', $simplecatch_favicon, 86940 );
}
echo $simplecatch_favicon ;
} // simplecatch_favicon
//Load Favicon in Header Section
add_action('wp_head', 'simplecatch_favicon');
//Load Favicon in Admin Section
add_action( 'admin_head', 'simplecatch_favicon' );
if ( ! function_exists( 'simplecatch_sliders' ) ) :
/**
* This function to display featured posts on homepage header
*
* @get the data value from theme options
* @displays on the homepage header
*
* @useage Featured Image, Title and Content of Post
*
* @uses set_transient and delete_transient
*/
function simplecatch_sliders() {
global $post;
//delete_transient( 'simplecatch_sliders' );
global $simplecatch_options_settings;
$options = $simplecatch_options_settings;
$postperpage = $options[ 'slider_qty' ];
if( ( !$simplecatch_sliders = get_transient( 'simplecatch_sliders' ) ) && !empty( $options[ 'featured_slider' ] ) ) {
echo '';
$simplecatch_sliders = '