max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "\n"; } } // Content width if (! isset ($content_width)) { $content_width = 730; } // Accent Color function barkly_accentcolor() { $barkly_accentcolor = get_theme_mod('barkly_general_link', '#427eb9'); echo esc_attr( 'a { color:'.$barkly_accentcolor.'}; blockquote: border-left: 5px solid'.$barkly_accentcolor.';} .entry-title a:hover { color:'. $barkly_accentcolor.';}' ) ; } // Widget style function barkly_widgetclass() { if(get_theme_mod('barkly_general_widgets') == 'minimal') { echo esc_attr( ' widgets-minimal' ); } } // Category list function barkly_categorylist() { $categories = get_the_category(); $separator = ', '; $output = ''; if ( ! empty( $categories ) ) { foreach( $categories as $category ) { $output .= '' . esc_html( $category->name ) . '' . $separator; } echo trim( $output, $separator ); } } // Main container class function barkly_containerclass() { if(get_theme_mod('barkly_header_sticky') == 'true') { echo esc_attr( 'container main pt60' ); } else { echo esc_attr( 'container main' ); } } // Main menu style function barkly_navbarcolor() { if(get_theme_mod('barkly_header_mainmenu', 'dark') == 'light') { echo esc_attr( 'navbar-light bg-light'); } elseif(get_theme_mod('barkly_header_mainmenu', 'dark') == 'white') { echo esc_attr( 'navbar-light bg-light bg-white'); } elseif(get_theme_mod('barkly_header_mainmenu', 'dark') == 'custom') { echo esc_attr( 'navbar-dark bg-dark'); } else { echo esc_attr( 'navbar-dark bg-dark'); } } // Custom function barkly_navbarcolor_custom() { $barkly_header_custom = get_theme_mod('barkly_header_mainmenu_custom', '#427eb9'); if(get_theme_mod('barkly_header_mainmenu') == 'custom') { echo esc_attr( ' style=background-color:'.$barkly_header_custom.'!important'); } } /** * Filter the except length. * */ function barkly_custom_excerpt_length( $length ) { if ( is_home() && !get_theme_mod( 'xmag_magazine' ) ) { $excerpt_length = get_theme_mod( 'barkly_general_excerpt_size', 25 ); } elseif ( is_archive() || is_search() ) { $excerpt_length = get_theme_mod( 'barkly_general_excerpt_size', 25 ); } else { $excerpt_length = 30; } return $excerpt_length; } add_filter( 'excerpt_length', 'barkly_custom_excerpt_length', 999 ); // post per page function hwl_home_pagesize( $query ) { if ( is_admin() || ! $query->is_main_query() ) return; if ( is_home() ) { $query->set( 'posts_per_page', get_theme_mod('barkly_general_prp', '5')); return; } if ( is_tag() ) { $query->set( 'posts_per_page', get_theme_mod('barkly_general_prt', '10') ); return; } if ( is_category() ) { $query->set( 'posts_per_page', get_theme_mod('barkly_general_prc', '5') ); return; } if ( is_search() ) { $query->set( 'posts_per_page', get_theme_mod('barkly_general_prs', '10') ); return; } if ( is_archive( ) ) { $query->set( 'posts_per_page', get_theme_mod('barkly_general_pra', '10') ); return; } } add_action('pre_get_posts', 'hwl_home_pagesize', 1 ); //Register Sidebar function barkly_sidebar() { $args = array( 'id' => 'sidebar-right', 'name' => __( 'Sidebar', 'barkly' ), 'description' => __( 'Right Sidebar', 'barkly' ), 'class' => 'barkly-widget', 'before_title' => '

', 'after_title' => '

', 'before_widget' => '', ); register_sidebar( $args ); } // Hook into the 'widgets_init' action add_action( 'widgets_init', 'barkly_sidebar' ); register_nav_menus( array( 'primary' => __( 'Primary Menu', 'barkly' ), ) ); add_action('after_setup_theme', 'true_load_theme_textdomain');