remove_control("blogdescription"); $wp_customize->remove_control("display_header_text"); $wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage'; $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage'; if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'blogname', array( 'selector' => '.site-title a', 'render_callback' => 'affiliatebooster_customize_partial_blogname', ) ); $wp_customize->selective_refresh->add_partial( 'blogdescription', array( 'selector' => '.site-description', 'render_callback' => 'affiliatebooster_customize_partial_blogdescription', ) ); } $wp_customize->add_setting( 'tsum_options[hide_title]', array( 'default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr' )); // FRONT BOX CHECK - CONTROL $wp_customize->add_control( 'hide_title', array( 'label' => 'Hide Title', 'section' => 'title_tagline', 'settings' => 'tsum_options[hide_title]', 'type' => 'checkbox', //'priority' => 20, )); $wp_customize->add_setting( 'blogdescription', array( 'default' => get_option( 'blogdescription' ), 'type' => 'option', 'capability' => 'manage_options', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( 'blogdescription', array( 'label' => __( 'Tagline', 'affiliate-booster' ), 'section' => 'title_tagline', ) ); $wp_customize->add_setting( 'tsum_options[hide_tagline]', array( 'default' => false, 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_attr' )); // FRONT BOX CHECK - CONTROL $wp_customize->add_control( 'hide_tagline', array( 'label' => 'Hide Tagline', 'section' => 'title_tagline', 'settings' => 'tsum_options[hide_tagline]', 'type' => 'checkbox', //'priority' => 20, )); // Display Site Title $wp_customize->add_setting( 'display_site_title', array( 'default' => false, 'transport' => 'postMessage', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( 'display_site_title', array( 'label' => __( 'Display Site Title', 'affiliate-booster' ), 'type' => 'checkbox', 'section' => 'title_tagline', 'settings' => 'tsum_optiot', ) ); $wp_customize->add_setting( 'aff_logo', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'aff_logo', array( 'label' => __( 'Site Logo ', 'affiliate-booster' ), 'description' => __( 'Recommended Logo Size: 220px x 100px', 'affiliate-booster' ), 'section' => 'title_tagline', 'settings' => 'aff_logo', ) ) ); } add_action( 'customize_register', 'affiliatebooster_customize_register' ); /** * Render the site title for the selective refresh partial. * * @return void */ function affiliatebooster_customize_partial_blogname() { bloginfo( 'name' ); } /** * Render the site tagline for the selective refresh partial. * * @return void */ function affiliatebooster_customize_partial_blogdescription() { bloginfo( 'description' ); } /** * Binds JS handlers to make Theme Customizer preview reload changes asynchronously. */ function affiliatebooster_customize_preview_js() { wp_enqueue_script( 'affiliatebooster-customizer', get_template_directory_uri() . '/dist/js/customizer.min.js', array( 'customize-preview' ), '_S_VERSION', true ); } add_action( 'customize_preview_init', 'affiliatebooster_customize_preview_js' ); //------------------------------NEW-----------------------------------// /** * Add Default Font (Google Font - Poppins). */ function wdm_load_fonts() { wp_register_style( 'wdm-googleFonts-single', '//fonts.googleapis.com/css?family=Poppins'); wp_enqueue_style( 'wdm-googleFonts-single' ); } add_action( 'wp_print_styles', 'wdm_load_fonts' ); add_action( 'admin_enqueue_scripts', 'wdm_load_fonts' ); function afftheme_fixed_header() { $top_head = get_theme_mod( 'aff_header_setting_fixed_top', false ); $mid_head = get_theme_mod( 'aff_header_sticky_settings', false ); $bot_head = get_theme_mod( 'aff_header_setting_fixed', false ); if ( true == $top_head ) { ?> __( 'Primary Menu', 'affiliate-booster'), 'secondary-menu' => __( 'Secondary Menu', 'affiliate-booster' ), 'footer-menu' => __( 'Footer Menu', 'affiliate-booster' ), 'above-header-menu' => __( 'Above Header Menu', 'affiliate-booster' ), ) ); } add_action( 'init', 'register_my_menus' ); function custom_logo(){ $custom_logo = get_theme_mod( 'aff_logo' ); if($custom_logo){ ?> " rel="home">

'; } } function set_number_views() { global $post; $post_id = $post->ID; $count_key = 'post_views_count'; $count = get_post_meta($post_id, $count_key, true); if($count ==''){ $count = 0; add_post_meta($post_id, $count_key, '0'); }else{ $count++; update_post_meta($post_id, $count_key, $count); } } add_filter('manage_posts_columns', 'posts_column_views'); add_action('manage_posts_custom_column', 'posts_custom_column_views',5,2); function posts_column_views($defaults){ $defaults['post_views'] = __('Views', 'affiliate-booster'); return $defaults; } function posts_custom_column_views($column_name, $id){ $column_name; if($column_name === 'post_views'){ echo get_post_meta($id, 'post_views_count', true); } } // Remove comment date function wpb_remove_comment_date($date, $d, $comment) { if ( !is_admin() ) { return; } else { return $date; } } //add_filter( 'get_comment_date', 'wpb_remove_comment_date', 10, 3); // Remove comment time function wpb_remove_comment_time($date, $d, $comment) { if ( !is_admin() ) { return; } else { return $date; } } //add_filter( 'get_comment_time', 'wpb_remove_comment_time', 10, 3); //Comment move fields to bottom function wpb_move_comment_field_to_bottom( $fields ) { $comment_field = $fields['comment']; unset( $fields['comment'] ); unset( $fields['cookies-consent'] ); $fields['comment'] = $comment_field; return $fields; } add_filter( 'comment_form_fields', 'wpb_move_comment_field_to_bottom' ); //Comment form restyle function affiliatebooster_update_comment_fields( $fields ) { $commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $label = $req ? '*' : ' ' . __( '(optional)', 'affiliate-booster' ); $aria_req = $req ? "aria-required='true'" : ''; $fields['author'] = '

'; $fields['email'] = '

'; $fields['url'] = '

'; return $fields; } add_filter( 'comment_form_default_fields', 'affiliatebooster_update_comment_fields' ); function affiliatebooster_update_comment_field( $comment_field ) { $comment_field = '

'; return $comment_field; } add_filter( 'comment_form_field_comment', 'affiliatebooster_update_comment_field' ); // Breadcrumbs function custom_breadcrumbs() { // Settings $separator = '>'; $breadcrums_id = 'breadcrumbs'; $breadcrums_class = 'breadcrumbs'; $home_title = 'Homepage'; // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat) $custom_taxonomy = 'product_cat'; // Get the query & post information global $post,$wp_query; // Do not display on the homepage if ( !is_front_page() ) { // Build the breadcrums echo ''; } } /* Search Query */ if (!is_admin()) { function wpb_search_filter($query) { if ($query->is_search) { $query->set('post_type', 'post'); } return $query; } add_filter('pre_get_posts','wpb_search_filter'); } /* Changed sidbar widget title to h3*/ function affiliate_change_widget_title_tag( $params ) { $params[0]['before_title'] = '

' ; $params[0]['after_title'] = '

' ; return $params; } add_filter( 'dynamic_sidebar_params' , 'affiliate_change_widget_title_tag' ); /* Add custom metabox in post */ add_action( 'admin_init', 'affiliatebooster_metabox_function' ); function affiliatebooster_metabox_function(){ add_meta_box( '_mymetaboxid', 'Add Container width', 'metaboxfunction1', ['post', 'page'], 'side' ); } function metaboxfunction1($post){ // Get meta box value $getmetaboxvalue = get_post_meta( $post->ID, '_mymetaboxname', true ) ? get_post_meta( $post->ID, '_mymetaboxname', true ) : ''; ?>