get( 'Version' ); wp_enqueue_style( 'sportsmag-parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'sportsmag-responsive', get_stylesheet_directory_uri() . '/css/responsive.css', esc_attr( $sportsmag_theme_version ) ); wp_enqueue_script( 'sportsmag-custom-scripts', get_stylesheet_directory_uri() . '/js/custom-scripts.js', array('jquery'), esc_attr( $sportsmag_theme_version ) ); $menu_sticky_option = of_get_option( 'menu_sticky', '1' ); if( !empty( $menu_sticky_option ) && $menu_sticky_option == 1 ) { wp_enqueue_script( 'sportsmag-sticky-menu-setting', get_stylesheet_directory_uri(). '/js/sportsmag-sticky-setting.js', array( 'jquery-sticky' ), esc_attr($sportsmag_theme_version), true ); } } add_action('wp_enqueue_scripts', 'sportsmag_styles_scripts'); function sportsmag_deque_script_settings() { wp_dequeue_script( 'accesspress-mag-sticky-menu-setting' ); } add_action( 'wp_footer', 'sportsmag_deque_script_settings', 11 ); /* ================================================================================================================================ */ /** * Add some option in theme option */ function child_theme_options($options) { $options[] = array( 'name' => __( 'Child Theme Settings', 'sportsmag' ), 'type' => 'heading' ); $options[] = array( 'name' => __( 'Home Page Settings', 'sportsmag' ), 'type' => 'groupstart', 'id' => 'child_theme_home_settings' ); $options[] = array( 'name' => __( 'Latest Articles', 'sportsmag' ), 'desc' => __( 'Show or hide latest ariticle section', 'sportsmag' ), 'id' => 'popular_section_option', 'on' => __( 'Show', 'sportsmag' ), 'off' => __( 'Hide', 'sportsmag' ), 'std' => '1', 'type' => 'switch' ); $options[] = array( 'name' => __( 'Latest Articles Title', 'sportsmag' ), 'desc' => __( 'Add block name as you like (example: Latest Articles)', 'sportsmag' ), 'id' => 'popular_block_name', 'type' => 'text', 'std' => __( 'Latest Articles', 'sportsmag' ), ); $options[] = array( 'name' => __( 'Youtube Lists', 'sportsmag' ), 'desc' => __( 'Show or hide youtube playlist section', 'sportsmag' ), 'id' => 'youtube_section_option', 'on' => __( 'Show', 'sportsmag' ), 'off' => __( 'Hide', 'sportsmag' ), 'std' => '1', 'type' => 'switch' ); $options[] = array( 'name' => __( 'Youtube Lists Title', 'sportsmag' ), 'desc' => __( 'Add your title for youtube list section', 'sportsmag' ), 'id' => 'youtube_list_title', 'type' => 'text', 'std' => 'Youtube Videos', ); $options[] = array( 'name' => __( 'Youtube Video Ids', 'sportsmag' ), 'desc' => __( "Add youtube id's separated by comma (ex: xrt27dZ7DOA, u8--jALkijM, HusniLw9i68):", 'sportsmag' ), 'id' => 'youtube_list_ids', 'type' => 'text', 'std' => ' ', ); $options[] = array( 'type' => 'groupend' ); return $options; } add_filter('of_options', 'child_theme_options'); /* ================================================================================================================================ */ /** * Disable header ad widget area */ add_action( 'widgets_init', 'disable_header_ad_widgets', 50 ); function disable_header_ad_widgets() { unregister_sidebar( 'accesspress-mag-header-ad' ); } /* ================================================================================================================================ */ /** * Function to replace slider in SportsMag */ add_action( 'sportsmag_grid', 'sportsmag_grid_callback', 10 ); if ( !function_exists( 'sportsmag_grid_callback' ) ): function sportsmag_grid_callback() { $sportsmag_slider_posts_option = of_get_option( 'slider_post_option', ' ' ); $sportsmag_slider_category = of_get_option( 'homepage_slider_category' ); $sportsmag_grid_args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 5, 'order' => 'DESC', 'meta_query' => array( array( 'key' => '_thumbnail_id', 'compare' => '!=', 'value' => null ) ) ); if ( ( $sportsmag_slider_posts_option == 'cat' ) && ( !empty( $sportsmag_slider_category ) ) ) { $sportsmag_grid_args['category_name'] = $sportsmag_slider_category; } $sportsmag_grid_query = new WP_Query( $sportsmag_grid_args ); $sportsmag_grid_count = 0; if ( $sportsmag_grid_query->have_posts() ) { ?>