'ffffff', ) ); $GLOBALS['content_width'] = apply_filters( 'boat_rental_content_width', 1140 ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'custom-logo', array( 'height' => 270, 'width' => 90, 'flex-height' => true, 'flex-width' => true, ) ); add_theme_support( 'title-tag' ); load_theme_textdomain( 'boat-rental', get_template_directory() . '/languages' ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'script', 'style', ) ); add_theme_support( 'post-formats', array( 'video', 'audio', 'gallery', 'quote', 'image', 'link', 'status', 'aside', 'chat', ) ); add_theme_support( 'align-wide' ); add_theme_support( 'responsive-embeds' ); add_theme_support( 'wp-block-styles' ); require get_template_directory() . '/inc/metabox.php'; } endif; add_action( 'after_setup_theme', 'boat_rental_after_theme_support' ); /** * Register and Enqueue Styles. */ function boat_rental_register_styles() { wp_enqueue_style( 'dashicons' ); $boat_rental_theme_version = wp_get_theme()->get( 'Version' ); $boat_rental_fonts_url = boat_rental_fonts_url(); if( $boat_rental_fonts_url ){ require get_theme_file_path( 'lib/custom/css/wptt-webfont-loader.php' ); wp_enqueue_style( 'boat-rental-google-fonts', wptt_get_webfont_url( $boat_rental_fonts_url ), array(), $boat_rental_theme_version ); } wp_enqueue_style( 'owl.carousel', get_template_directory_uri() . '/lib/custom/css/owl.carousel.min.css'); wp_enqueue_style( 'swiper', get_template_directory_uri() . '/lib/swiper/css/swiper-bundle.min.css'); wp_enqueue_style( 'boat-rental-style', get_stylesheet_uri(), array(), $boat_rental_theme_version ); wp_enqueue_style( 'boat-rental-style', get_stylesheet_uri() ); require get_parent_theme_file_path( '/custom_css.php' ); wp_add_inline_style( 'boat-rental-style',$boat_rental_custom_css ); $boat_rental_css = ''; if ( get_header_image() ) : $boat_rental_css .= ' .header-navbar{ background-image: url('.esc_url(get_header_image()).'); -webkit-background-size: cover !important; -moz-background-size: cover !important; -o-background-size: cover !important; background-size: cover !important; }'; endif; wp_add_inline_style( 'boat-rental-style', $boat_rental_css ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_enqueue_script( 'imagesloaded' ); wp_enqueue_script( 'masonry' ); wp_enqueue_script( 'owl.carousel', get_template_directory_uri() . '/lib/custom/js/owl.carousel.js', array('jquery'), '', 1); wp_enqueue_script( 'swiper', get_template_directory_uri() . '/lib/swiper/js/swiper-bundle.min.js', array('jquery'), '', 1); wp_enqueue_script( 'boat-rental-custom', get_template_directory_uri() . '/lib/custom/js/theme-custom-script.js', array('jquery'), '', 1); // Global Query if( is_front_page() ){ $boat_rental_posts_per_page = absint( get_option('posts_per_page') ); $boat_rental_c_paged = ( get_query_var( 'page' ) ) ? absint( get_query_var( 'page' ) ) : 1; $boat_rental_posts_args = array( 'posts_per_page' => $boat_rental_posts_per_page, 'paged' => $boat_rental_c_paged, ); $posts_qry = new WP_Query( $boat_rental_posts_args ); $max = $posts_qry->max_num_pages; }else{ global $wp_query; $max = $wp_query->max_num_pages; $boat_rental_c_paged = ( get_query_var( 'paged' ) > 1 ) ? get_query_var( 'paged' ) : 1; } $boat_rental_default = boat_rental_get_default_theme_options(); $boat_rental_pagination_layout = get_theme_mod( 'boat_rental_pagination_layout',$boat_rental_default['boat_rental_pagination_layout'] ); } add_action( 'wp_enqueue_scripts', 'boat_rental_register_styles',200 ); function boat_rental_admin_enqueue_scripts_callback() { if ( ! did_action( 'wp_enqueue_media' ) ) { wp_enqueue_media(); } wp_enqueue_script('boat-rental-uploaderjs', get_stylesheet_directory_uri() . '/lib/custom/js/uploader.js', array(), "1.0", true); } add_action( 'admin_enqueue_scripts', 'boat_rental_admin_enqueue_scripts_callback' ); /** * Register navigation menus uses wp_nav_menu in five places. */ function boat_rental_menus() { $boat_rental_locations = array( 'boat-rental-primary-menu' => esc_html__( 'Primary Menu', 'boat-rental' ), ); register_nav_menus( $boat_rental_locations ); } add_action( 'init', 'boat_rental_menus' ); add_filter('loop_shop_columns', 'boat_rental_loop_columns'); if (!function_exists('boat_rental_loop_columns')) { function boat_rental_loop_columns() { $boat_rental_columns = get_theme_mod( 'boat_rental_per_columns', 3 ); return $boat_rental_columns; } } add_filter( 'loop_shop_per_page', 'boat_rental_per_page', 20 ); function boat_rental_per_page( $boat_rental_cols ) { $boat_rental_cols = get_theme_mod( 'boat_rental_product_per_page', 9 ); return $boat_rental_cols; } function boat_rental_products_args( $boat_rental_args ) { $boat_rental_args['posts_per_page'] = get_theme_mod( 'boat_rental_custom_related_products_number', 6 ); $boat_rental_args['columns'] = get_theme_mod( 'boat_rental_custom_related_products_number_per_row', 3 ); return $boat_rental_args; } require get_template_directory() . '/inc/custom-header.php'; require get_template_directory() . '/classes/class-svg-icons.php'; require get_template_directory() . '/classes/class-walker-menu.php'; require get_template_directory() . '/inc/customizer/customizer.php'; require get_template_directory() . '/inc/custom-functions.php'; require get_template_directory() . '/inc/template-tags.php'; require get_template_directory() . '/classes/body-classes.php'; require get_template_directory() . '/inc/widgets/widgets.php'; require get_template_directory() . '/inc/pagination.php'; require get_template_directory() . '/lib/breadcrumbs/breadcrumbs.php'; require get_template_directory() . '/lib/custom/css/dynamic-style.php'; require get_template_directory() . '/inc/general.php'; require get_template_directory() . '/inc/TGM/tgm.php'; function boat_rental_remove_customize_register() { global $wp_customize; $wp_customize->remove_setting( 'display_header_text' ); $wp_customize->remove_control( 'display_header_text' ); } add_action( 'customize_register', 'boat_rental_remove_customize_register', 11 ); function boat_rental_radio_sanitize( $boat_rental_input, $boat_rental_setting ) { $boat_rental_input = sanitize_key( $boat_rental_input ); $boat_rental_choices = $boat_rental_setting->manager->get_control( $boat_rental_setting->id )->choices; return ( array_key_exists( $boat_rental_input, $boat_rental_choices ) ? $boat_rental_input : $boat_rental_setting->default ); }