'."\n"; } } /** * Extend the default WordPress body classes. * * @since Agama 1.0.0 * @param array $classes Existing class values. * @return array Filtered class values. */ function body_class( $classes ) { $background_color = esc_attr( get_background_color() ); $background_image = esc_url( get_background_image() ); $header = esc_attr( get_theme_mod( 'agama_header_style', 'transparent' ) ); $sidebar_position = esc_attr( get_theme_mod( 'agama_sidebar_position', 'right' ) ); $blog_layout = esc_attr( get_theme_mod('agama_blog_layout', 'list') ); // Apply header style class. switch( $header ) { case 'transparent': $classes[] = 'header_v1'; break; case 'sticky': $classes[] = 'sticky_header'; break; } // Apply sidebar position class. if( $sidebar_position == 'left' ) { $classes[] = 'sidebar-left'; } // Apply blog layout class. switch( $blog_layout ) { case 'small_thumbs': $classes[] = 'blog-small-thumbs'; break; case 'grid': $classes[] = 'blog-grid'; break; } // Apply template full-width class. if ( is_page_template( 'page-templates/full-width.php' ) ) { $classes[] = 'full-width'; } // Apply front page class. if ( is_page_template( 'page-templates/front-page.php' ) ) { $classes[] = 'template-front-page'; if ( has_post_thumbnail() ) $classes[] = 'has-post-thumbnail'; } // Apply empty background class. if ( empty( $background_image ) ) { if ( empty( $background_color ) ) $classes[] = 'custom-background-empty'; elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) ) $classes[] = 'custom-background-white'; } // Apply custom font enabled class. if ( wp_style_is( 'PTSans', 'queue' ) ) $classes[] = 'custom-font-enabled'; // Apply single author class. if ( ! is_multi_author() ) $classes[] = 'single-author'; return $classes; } /** * Header Style Class * * @since 1.2.0 */ static function header_class() { $header = get_theme_mod( 'agama_header_style', 'transparent' ); switch( $header ): case 'transparent': $class = 'header_v1'; break; case 'default': $class = 'header_v2'; break; case 'sticky': $class = 'header_v3'; break; endswitch; echo $class; } /** * Bootstrap Content Wrapper Class * * @since 1.1.7 */ static function bs_class() { if( is_active_sidebar( 'sidebar-1' ) ) { $class = 'col-md-9'; } else { $class = 'col-md-12'; } return esc_attr( $class ); } /** * Excerpt Lenght * * @since 1.0.0 */ function excerpt_length( $length ) { return esc_attr( get_theme_mod('agama_blog_excerpt', '60') ); } /** * Replaces Excerpt "more" Text by Link * * @since 1.1.1 */ function excerpt_more( $more ) { global $post; if( get_theme_mod('agama_blog_readmore_url', true) ) { return sprintf('

%s', get_permalink($post->ID), __('Read More', 'agama')); } return; } /** * Add Class to Post Edit Link * * @since 1.1.1 */ function edit_post_link( $output ) { $output = str_replace('class="post-edit-link"', 'class="button button-3d button-mini button-rounded"', $output); return $output; } /** * Add Class to Post Edit Comment Link * * @since 1.1.1 */ function edit_comment_link( $output ) { $output = str_replace('class="comment-edit-link"', 'class="button button-3d button-mini button-rounded"', $output); return $output; } /** * Render Menu Content * * @since 1.1.1 */ public static function menu( $location = false, $class = false ) { // If location not set if( ! $location ) return; $args = array( 'theme_location' => $location, 'menu_class' => $class, 'container' => false, 'echo' => '0' ); $menu = wp_nav_menu( $args ); return $menu; } /** * Render Social Icons * * @since 1.1.1 * @updated @since 1.1.2 */ public static function sociali( $tip_position = false, $style = false ) { // Url target $_target = esc_attr( get_theme_mod('agama_social_url_target', '_self') ); // Social icons $social = array( 'Facebook' => esc_url( get_theme_mod('social_facebook', '') ), 'Twitter' => esc_url( get_theme_mod('social_twitter', '') ), 'Flickr' => esc_url( get_theme_mod('social_flickr', '') ), 'Vimeo' => esc_url( get_theme_mod('social_vimeo', '') ), 'Youtube' => esc_url( get_theme_mod('social_youtube', '') ), 'Instagram' => esc_url( get_theme_mod('social_instagram', '') ), 'Pinterest' => esc_url( get_theme_mod('social_pinterest', '') ), 'Tumblr' => esc_url( get_theme_mod('social_tumblr', '') ), 'Google' => esc_url( get_theme_mod('social_google', '') ), 'Dribbble' => esc_url( get_theme_mod('social_dribbble', '') ), 'Digg' => esc_url( get_theme_mod('social_digg', '') ), 'Linkedin' => esc_url( get_theme_mod('social_linkedin', '') ), 'Blogger' => esc_url( get_theme_mod('social_blogger', '') ), 'Skype' => esc_html( get_theme_mod('social_skype', '') ), 'Forrst' => esc_url( get_theme_mod('social_forrst', '') ), 'Myspace' => esc_url( get_theme_mod('social_myspace', '') ), 'Deviantart'=> esc_url( get_theme_mod('social_deviantart', '') ), 'Yahoo' => esc_url( get_theme_mod('social_yahoo', '') ), 'Reddit' => esc_url( get_theme_mod('social_reddit', '') ), 'PayPal' => esc_url( get_theme_mod('social_paypal', '') ), 'Dropbox' => esc_url( get_theme_mod('social_dropbox', '') ), 'Soundcloud'=> esc_url( get_theme_mod('social_soundcloud', '') ), 'VK' => esc_url( get_theme_mod('social_vk', '') ), 'Email' => esc_url( get_theme_mod('social_email', '') ), 'RSS' => esc_url( get_theme_mod('social_rss', get_bloginfo('rss2_url')) ) ); if( $style == 'animated' ): echo ''; else: foreach( $social as $name => $url ) { if( ! empty( $url ) ) { echo sprintf ( '', esc_attr( strtolower($name) ), $url, $_target, esc_attr( $tip_position ), esc_attr( $name ) ); } } endif; } /** * Get Post Format * * @since 1.1.1 */ public static function post_format() { $post_format = get_post_format(); switch( $post_format ) { case 'aside': $icon = ''; break; case 'chat': $icon = ''; break; case 'gallery': $icon = ''; break; case 'link': $icon = ''; break; case 'image': $icon = ''; break; case 'quote': $icon = ''; break; case 'status': $icon = ''; break; case 'video': $icon = ''; break; case 'audio': $icon = ''; break; default: $icon = ''; } return $icon; } /** * Count Comments * * @since 1.1.1 */ public static function comments_count() { $comments = 0; if( comments_open() ) { $comments = sprintf('%s', get_comments_link(), get_comments_number() . __( ' comments', 'agama' ) ); } return $comments; } /** * Next | Previous - Post Links * * @since 1.0.0 */ public static function post_prev_next_links() { if( get_previous_post_link() || get_next_post_link() ) { ?>