= 2 || $page >= 2 ) {
$filtered_title .= ' | ' . sprintf( __( 'Page %s', 'attitude' ), max( $paged, $page ) );
}
// Return the modified title
return $filtered_title;
}
/****************************************************************************************/
add_action( 'attitude_links', 'attitude_add_links', 10 );
/**
* Adding link to stylesheet file
*
* @uses get_stylesheet_uri()
*/
function attitude_add_links() {
?>
';
}
}
set_transient( 'attitude_favicon', $attitude_favicon, 86940 );
}
echo $attitude_favicon ;
}
/****************************************************************************************/
// Load webpageicon in Header Section
add_action( 'attitude_links', 'attitude_webpageicon', 20 );
/**
* Get the webpageicon Image from theme options
* display webpageicon
*
* @uses set_transient and delete_transient
*/
function attitude_webpageicon() {
$attitude_webpageicon = '';
if( ( !$attitude_webpageicon = get_transient( 'attitude_webpageicon' ) ) ) {
global $attitude_theme_options_settings;
$options = $attitude_theme_options_settings;
if ( "0" == $options[ 'disable_webpageicon' ] ) {
if ( !empty( $options[ 'webpageicon' ] ) ) {
$attitude_webpageicon .= ' ';
}
}
set_transient( 'attitude_webpageicon', $attitude_webpageicon, 86940 );
}
echo $attitude_webpageicon ;
}
/****************************************************************************************/
add_action( 'attitude_header', 'attitude_headerdetails', 10 );
/**
* Shows Header Part Content
*
* Shows the site logo, title, description, searchbar, social icons etc.
*/
function attitude_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 ] ) ) {
$attitude_socialnetworks .=
''.get_bloginfo( 'name' ).$key.' ';
}
}
$attitude_socialnetworks .='
';
set_transient( 'attitude_socialnetworks', $attitude_socialnetworks, 86940 );
}
echo $attitude_socialnetworks;
}
endif;
/****************************************************************************************/
if ( ! function_exists( 'attitude_home_slogan' ) ) :
/**
* Display Home Slogan.
*
* Function that enable/disable the home slogan1 and home slogan2.
*/
function attitude_home_slogan() {
global $attitude_theme_options_settings;
$options = $attitude_theme_options_settings;
$attitude_home_slogan = '';
if( ( !$attitude_home_slogan = get_transient( 'attitude_home_slogan' ) ) && ( !empty( $options[ 'home_slogan1' ] ) || !empty( $options[ 'home_slogan2' ] ) ) ) {
if ( "0" == $options[ 'disable_slogan' ] ) {
$attitude_home_slogan .= '';
if ( !empty( $options[ 'home_slogan1' ] ) ) {
$attitude_home_slogan .= esc_html( $options[ 'home_slogan1' ] );
}
if ( !empty( $options[ 'home_slogan2' ] ) ) {
$attitude_home_slogan .= ''.esc_html( $options[ 'home_slogan2' ] ).' ';
}
$attitude_home_slogan .= '
';
if ( !empty( $options[ 'button_text' ] ) && !empty( $options[ 'redirect_button_link' ] ) ) {
$attitude_home_slogan .= '
'.esc_html( $options[ 'button_text' ] ).' ';
}
$attitude_home_slogan .= '
';
}
set_transient( 'attitude_home_slogan', $attitude_home_slogan, 86940 );
}
echo $attitude_home_slogan;
}
endif;
/****************************************************************************************/
if ( ! function_exists( 'attitude_featured_post_slider' ) ) :
/**
* display featured post slider
*
* @uses set_transient and delete_transient
*/
function attitude_featured_post_slider() {
global $post;
global $attitude_theme_options_settings;
$options = $attitude_theme_options_settings;
$attitude_featured_post_slider = '';
if( ( !$attitude_featured_post_slider = get_transient( 'attitude_featured_post_slider' ) ) && !empty( $options[ 'featured_post_slider' ] ) ) {
if( 'wide-layout' == $options[ 'site_layout' ] ) {
$slider_size = 'slider-wide';
}
else {
$slider_size = 'slider-narrow';
}
$attitude_featured_post_slider .= '
';
$get_featured_posts = new WP_Query( array(
'posts_per_page' => $options[ 'slider_quantity' ],
'post_type' => array( 'post', 'page' ),
'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"; }
$attitude_featured_post_slider .= '
';
endwhile; wp_reset_query();
$attitude_featured_post_slider .= '
';
set_transient( 'attitude_featured_post_slider', $attitude_featured_post_slider, 86940 );
}
echo $attitude_featured_post_slider;
}
endif;
/****************************************************************************************/
if ( ! function_exists( 'attitude_breadcrumb' ) ) :
/**
* 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 attitude_breadcrumb() {
if( function_exists( 'bcn_display' ) ) {
echo '';
bcn_display();
echo '
';
}
}
endif;
/****************************************************************************************/
if ( ! function_exists( 'attitude_header_title' ) ) :
/**
* Show the title in header
*
* @since Attitude 1.0
*/
function attitude_header_title() {
if( is_archive() ) {
$attitude_header_title = single_cat_title( '', FALSE );
}
elseif( is_404() ) {
$attitude_header_title = __( 'Page NOT Found', 'attitude' );
}
elseif( is_search() ) {
$attitude_header_title = __( 'Search Results', 'attitude' );
}
elseif( is_page_template() ) {
$attitude_header_title = get_the_title();
}
else {
$attitude_header_title = '';
}
return $attitude_header_title;
}
endif;
?>