= 2 || $page >= 2 ) {
$filtered_title .= ' | ' . sprintf( __( 'Page %s', 'cleanretina' ), max( $paged, $page ) );
}
// Return the modified title
return $filtered_title;
}
/****************************************************************************************/
add_action( 'cleanretina_links', 'cleanretina_add_links', 10 );
/**
* Adding link to stylesheet file
*
* @uses get_stylesheet_uri()
*/
function cleanretina_add_links() {
?>
';
}
}
set_transient( 'cleanretina_favicon', $cleanretina_favicon, 86940 );
}
echo $cleanretina_favicon ;
}
/****************************************************************************************/
// Load webpageicon in Header Section
add_action( 'cleanretina_links', 'cleanretina_webpageicon', 20 );
/**
* Get the webpageicon Image from theme options
* display webpageicon
*
* @uses set_transient and delete_transient
*/
function cleanretina_webpageicon() {
$cleanretina_webpageicon = '';
if( ( !$cleanretina_webpageicon = get_transient( 'cleanretina_webpageicon' ) ) ) {
global $cleanretina_theme_options_settings;
$options = $cleanretina_theme_options_settings;
if ( "0" == $options[ 'disable_webpageicon' ] ) {
if ( !empty( $options[ 'webpageicon' ] ) ) {
$cleanretina_webpageicon .= ' ';
}
}
set_transient( 'cleanretina_webpageicon', $cleanretina_webpageicon, 86940 );
}
echo $cleanretina_webpageicon ;
}
/****************************************************************************************/
add_action( 'cleanretina_header', 'cleanretina_headerdetails', 10 );
/**
* Shows Header Part Content
*
* Shows the site logo, title, description, searchbar, social icons etc.
*/
function cleanretina_headerdetails() {
?>
'primary',
'container' => '',
'items_wrap' => '
'
);
echo '
';
wp_nav_menu( $args );
echo ' ';
}
else {
echo '
';
wp_page_menu( array( 'menu_class' => 'root' ) );
echo ' ';
}
?>
';
$social_links = array();
$social_links = array( 'Facebook' => 'social_facebook',
'Twitter' => 'social_twitter',
'Google-Plus' => 'social_googleplus',
'Pinterest' => 'social_pinterest',
'You-tube' => 'social_youtube',
'Vimeo' => 'social_vimeo',
'Linked' => 'social_linkedin',
'Flickr' => 'social_flickr',
'Tumblr' => 'social_tumblr',
'My-Space' => 'social_myspace',
'RSS' => 'social_rss'
);
foreach( $social_links as $key => $value ) {
if ( !empty( $options[ $value ] ) ) {
$cleanretina_socialnetworks .=
''.get_bloginfo( 'name' ).$key.' ';
}
}
$cleanretina_socialnetworks .='
';
set_transient( 'cleanretina_socialnetworks', $cleanretina_socialnetworks, 86940 );
}
echo $cleanretina_socialnetworks;
}
/****************************************************************************************/
/**
* Display Home Slogan.
*
* Function that enable/disable the home slogan1 and home slogan2.
*/
function cleanretina_home_slogan() {
global $cleanretina_theme_options_settings;
$options = $cleanretina_theme_options_settings;
$cleanretina_home_slogan = '';
if( ( !$cleanretina_home_slogan = get_transient( 'cleanretina_home_slogan' ) ) && ( !empty( $options[ 'home_slogan1' ] ) || !empty( $options[ 'home_slogan2' ] ) ) ) {
if ( "0" == $options[ 'disable_slogan' ] ) {
$cleanretina_home_slogan .= '';
if ( !empty( $options[ 'home_slogan1' ] ) ) {
$cleanretina_home_slogan .= $options[ 'home_slogan1' ];
}
if ( !empty( $options[ 'home_slogan2' ] ) ) {
$cleanretina_home_slogan .= ''.$options[ 'home_slogan2' ].' ';
}
$cleanretina_home_slogan .= ' ';
}
set_transient( 'cleanretina_home_slogan', $cleanretina_home_slogan, 86940 );
}
echo $cleanretina_home_slogan;
}
/****************************************************************************************/
/**
* display featured post slider
*
* @uses set_transient and delete_transient
*/
function cleanretina_featured_post_slider() {
global $post;
global $cleanretina_theme_options_settings;
$options = $cleanretina_theme_options_settings;
$cleanretina_featured_post_slider = '';
if( ( !$cleanretina_featured_post_slider = get_transient( 'cleanretina_featured_post_slider' ) ) && !empty( $options[ 'featured_post_slider' ] ) ) {
$cleanretina_featured_post_slider .= '
';
$get_featured_posts = new WP_Query( array(
'posts_per_page' => $options[ 'slider_quantity' ],
'post__in' => $options[ 'featured_post_slider' ],
'orderby' => 'post__in',
'ignore_sticky_posts' => 1 // ignore sticky posts
));
$i=0; while ( $get_featured_posts->have_posts()) : $get_featured_posts->the_post(); $i++;
$title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) );
$excerpt = get_the_excerpt();
if ( 1 == $i ) { $classes = "slides displayblock"; } else { $classes = "slides displaynone"; }
$cleanretina_featured_post_slider .= '
';
endwhile; wp_reset_query();
$cleanretina_featured_post_slider .= '
';
set_transient( 'cleanretina_featured_post_slider', $cleanretina_featured_post_slider, 86940 );
}
echo $cleanretina_featured_post_slider;
}
/****************************************************************************************/
/**
* Display breadcrumb on header.
*
* If the page is home or front page, slider is displayed.
* In other pages, breadcrumb will display if breadcrumb NavXT plugin exists.
*/
function cleanretina_breadcrumb() {
if( function_exists( 'bcn_display_list' ) ) {
echo '
';
bcn_display_list();
echo '
';
}
}
?>