'#d6002a', 'gist-footer-copyright'=> esc_html__('All Right Reserved 2018','blog-path'), 'gist-footer-gototop' => 1, 'gist-sticky-sidebar'=> 1, 'gist-sidebar-options'=>'right-sidebar', 'gist-font-url'=> esc_url('//fonts.googleapis.com/css?family=Hind', 'blog-path'), 'gist-font-family' => esc_html__('Hind','blog-path'), 'gist-font-size'=> 16, 'gist-font-line-height'=> 2, 'gist-letter-spacing'=> 0, 'gist-blog-excerpt-options'=> 'excerpt', 'gist-blog-excerpt-length'=> 25, 'gist-blog-featured-image'=> 'full-image', 'gist-blog-meta-options'=> 1, 'gist-blog-read-more-options' => esc_html__('Continue Reading','blog-path'), 'gist-blog-related-post-options'=> 1, 'gist-blog-pagination-type-options'=>'numeric', 'gist-related-post'=> 0, 'gist-single-featured'=> 1, 'gist-footer-social' => 0, 'gist-extra-breadcrumb' => 1, 'gist-breadcrumb-text' => esc_html__('You Are Here','blog-path') ); return apply_filters( 'gist_default_theme_options', $default_theme_options ); } endif; /* Option to hide Related Post on Index Page*/ function blog_path_customize_register( $wp_customize ) { $default = gist_default_theme_options(); $wp_customize->add_setting( 'gist_theme_options[gist-blog-related-post-options]', array( 'capability' => 'edit_theme_options', 'default' => $default['gist-blog-related-post-options'], 'sanitize_callback' => 'gist_sanitize_checkbox' ) ); $wp_customize->add_control( 'gist_theme_options[gist-blog-related-post-options]', array( 'label' => __( 'Hide Related Post on Blog Listing Page', 'blog-path' ), 'description' => __( 'It will hide on Blog, Archive and Search Page', 'blog-path' ), 'section' => 'gist_blog_section', 'settings' => 'gist_theme_options[gist-blog-related-post-options]', 'type' => 'checkbox' ) ); } add_action( 'customize_register', 'blog_path_customize_register' ); /** * Display related posts from same category * * @since Gist 1.0.0 * * @param int $post_id * @return void * */ if ( !function_exists('blog_path_page_related_post') ) : function blog_path_page_related_post( $post_id ) { global $gist_theme_options; if( 0 == $gist_theme_options['gist-blog-related-post-options'] ){ return; } $categories = get_the_category( $post_id ); if ($categories) { $category_ids = array(); $category = get_category($category_ids); $categories = get_the_category( $post_id ); foreach ( $categories as $category ){ $category_ids[] = $category->term_id; } $count = $category->category_count; if($count > 1 ){ ?>