'portfolio', 'posts_per_page' => 6, ), // add another if you want array( 'post_type' => 'blogs', 'posts_per_page' => 3, ), array( 'post_type' => 'services', 'posts_per_page' => 4, ), ); foreach ($post_types_to_fix as $fix) { if ( array_key_exists('post_type', $query_string) && $query_string['post_type'] == $fix['post_type'] ) { $query_string['posts_per_page'] = $fix['posts_per_page']; return $query_string; } } return $query_string; } endif; add_filter('request', 'brikshya_portfolio_custom_posts_per_page'); /*-----------------------------------------------------------------------------------*/ /* Function Banner Image /*-----------------------------------------------------------------------------------*/ if (!function_exists('brikshya_portfolio_banner_image')) { function brikshya_portfolio_banner_image($id) { $banner_id = get_post_meta($id, '_banner_image', true); $image = brikshya_portfolio_cs('banner_img'); if ($banner_id) { $banner = (wp_get_attachment_image_src($banner_id, 'full')[0]); } elseif (!empty($image['url'])) { $banner = $image["url"]; } else { $banner = get_template_directory_uri() . '/assets/image/blog-bg.png'; } return $banner; }} /*-----------------------------------------------------------------------------------*/ /* Function featured Image /*-----------------------------------------------------------------------------------*/ if (!function_exists('brikshya_portfolio_featured_image')){ function brikshya_portfolio_featured_image($id) { $image_cs = brikshya_portfolio_cs('default_img'); if (has_post_thumbnail()) { $image = get_the_post_thumbnail_url($id, 'post-thumbnail'); } elseif (empty($image_url)) { $image = get_template_directory_uri() . '/assets/image/pink.jpg'; } else { $image = $image_url; } return $image; }} /*-----------------------------------------------------------------------------------*/ /* Function Customize Color /*-----------------------------------------------------------------------------------*/ if (!function_exists('brikshya_portfolio_customize_register')): function brikshya_portfolio_customize_register($wp_customize) { $wp_customize->add_setting('wp_theme_color', array( 'default' => '#f97c46', 'transport' => 'refresh', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_setting('wp_link_color', array( 'default' => '#f97c46', 'transport' => 'refresh', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_setting('wp_btn_color', array( 'default' => '#f97c46', 'transport' => 'refresh', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_setting('wp_btn_hover_color', array( 'default' => '#e2e6ea', 'transport' => 'refresh', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_section('wp_standard_colors', array( 'title' => __('Standard Colors', 'brikshya-portfolio'), 'priority' => 30, )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'wp_theme_color_control', array( 'label' => __('Theme Color', 'brikshya-portfolio'), 'section' => 'wp_standard_colors', 'settings' => 'wp_theme_color', ))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'wp_link_color_control', array( 'label' => __('Link Color', 'brikshya-portfolio'), 'section' => 'wp_standard_colors', 'settings' => 'wp_link_color', ))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'wp_btn_color_control', array( 'label' => __('Button Color', 'brikshya-portfolio'), 'section' => 'wp_standard_colors', 'settings' => 'wp_btn_color', ))); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'wp_btn_hover_color_control', array( 'label' => __('Button Hover Color', 'brikshya-portfolio'), 'section' => 'wp_standard_colors', 'settings' => 'wp_btn_hover_color', ))); } endif; add_action('customize_register', 'brikshya_portfolio_customize_register'); /*-----------------------------------------------------------------------------------*/ /* Output Customize CSS /*-----------------------------------------------------------------------------------*/ if (!function_exists('bikshya_portfolio_customize_css')): function bikshya_portfolio_customize_css() { ?>