Version; /*------------------------------------------------------------------------------------------------------------------*/ /** * Enqueue scripts and styles. * * @since 1.0.0 */ function parallaxsome_scripts() { global $parallaxsome_theme_version; $parallaxsome_font_args = array( 'family' => 'Open+Sans:400,600,700,800,300|PT+Sans:400,700|Lato:400,700,300|BenchNine:300|Roboto+Slab:300|Source+Sans+Pro:400,300,600,700|Raleway:400,500,600,700,800,300', ); wp_enqueue_style( 'parallaxsome-google-fonts', add_query_arg( $parallaxsome_font_args, "//fonts.googleapis.com/css" ) ); wp_enqueue_style( 'lightslider-style', get_template_directory_uri() . '/assets/library/lightslider/css/lightslider.css', array(), '1.1.3' ); wp_enqueue_style( 'bxSlider-style', get_template_directory_uri() . '/assets/library/bxSlider/css/jquery.bxslider.css', array(), '4.1.2' ); wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/library/font-awesome/css/font-awesome.min.css', array(), '4.6.3' ); wp_enqueue_style( 'jquery-prettyPhoto-style', get_template_directory_uri() . '/assets/library/prettyphoto/css/prettyPhoto.css', array(), '3.1.6' ); wp_enqueue_style ( 'animate', get_template_directory_uri() . '/assets/css/animate.css', array(), '3.5.1' ); wp_enqueue_style( 'parallaxsome-style', get_stylesheet_uri(), array(), $parallaxsome_theme_version ); wp_enqueue_script( 'lightslider', get_template_directory_uri() . '/assets/library/lightslider/js/lightslider.min.js', array( 'jquery' ), '1.1.3', true ); wp_enqueue_script( 'jquery-bxslider', get_template_directory_uri() . '/assets/library/bxSlider/js/jquery.bxslider.min.js', array( 'jquery' ), '4.1.2', true ); wp_enqueue_script( 'jquery-counterup', get_template_directory_uri() . '/assets/library/counterup/js/jquery.counterup.min.js', array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'jquery-waypoints', get_template_directory_uri() . '/assets/library/waypoints/js/jquery.waypoints.min.js', array( 'jquery' ), '2.0.5', true ); wp_enqueue_script( 'jquery-nav', get_template_directory_uri() . '/assets/library/jquery-nav/js/jquery.nav.js', array( 'jquery' ), '2.2.0', true ); wp_enqueue_script( 'jquery-scrollTo', get_template_directory_uri() . '/assets/library/jquery-scrollTo/js/jquery.scrollTo.js', array( 'jquery' ), '2.1.1', true ); wp_enqueue_script( 'jquery-prettyPhoto', get_template_directory_uri() . '/assets/library/prettyphoto/js/jquery.prettyPhoto.js', array( 'jquery' ), '3.1.6', true ); wp_enqueue_script( 'parallax', get_template_directory_uri() . '/assets/library/parallax-js/js/parallax.min.js', array( 'jquery' ), '1.4.2', true ); wp_enqueue_script( 'wow', get_template_directory_uri() . '/assets/js/wow.min.js', array( 'jquery' ), '1.1.2', true ); wp_enqueue_script( 'parallaxsome-custom-scripts', get_template_directory_uri() . '/assets/js/custom-scripts.js', array( 'jquery' ), $parallaxsome_theme_version, true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } $ps_header_sticky_option = get_theme_mod( 'sticky_header_option', 'enable' ); if( $ps_header_sticky_option != 'disable' ) { wp_enqueue_script( 'jquery-sticky', get_template_directory_uri() . '/assets/library/jquery-sticky/js/jquery.sticky.js', array( 'jquery' ), '1.0.2', true ); wp_enqueue_script( 'parallaxsome-sticky-setting', get_template_directory_uri() . '/assets/library/jquery-sticky/js/sticky-setting.js', array( 'jquery-sticky' ), '1.0.0', true ); } } add_action( 'wp_enqueue_scripts', 'parallaxsome_scripts' ); /*------------------------------------------------------------------------------------------------------------------*/ /** * Enqueue scripts/styles for admin area * * @since 1.0.0 */ if( ! function_exists( 'parallaxsome_admin_scripts' ) ): function parallaxsome_admin_scripts() { wp_enqueue_style( 'parallaxsome-admin-style', get_template_directory_uri() . '/assets/css/admin-styles.css' ); wp_enqueue_script( 'jquery-ui-button' ); wp_enqueue_script( 'parallaxsome-admin-scripts', get_template_directory_uri() . '/assets/js/admin-scripts.js', array( 'jquery', 'jquery-ui-button' ), true ); } endif; add_action( 'admin_enqueue_scripts', 'parallaxsome_admin_scripts' ); /*------------------------------------------------------------------------------------------------------------------*/ /** * Create a global variable for single page menu * * @return array * @since 1.0.0 */ $parallaxsome_single_menu_fields = array( 'slider' => array( 'default'=> esc_html__( 'Main', 'parallaxsome' ), 'label'=> esc_html__( 'Top Section', 'parallaxsome' ) ), 'about' => array( 'default'=> esc_html__( 'About', 'parallaxsome' ), 'label'=> esc_html__( 'About Us', 'parallaxsome' ) ), 'team' => array( 'default'=> esc_html( '', 'parallaxsome' ), 'label'=> esc_html__( 'Our Team', 'parallaxsome' ) ), 'services' => array( 'default'=> esc_html__( 'Services', 'parallaxsome' ), 'label'=> esc_html__( 'Our Services', 'parallaxsome' ) ), 'testimonials' => array( 'default'=> esc_html( '', 'parallaxsome' ), 'label'=> esc_html__( 'Client Says', 'parallaxsome' ) ), 'fact' => array( 'default'=> esc_html( '', 'parallaxsome' ), 'label'=> esc_html__( 'Fact Us', 'parallaxsome' ) ), 'portfolio' => array( 'default'=> esc_html__( 'Portfolio', 'parallaxsome' ), 'label'=> esc_html__( 'Portfolio', 'parallaxsome' ) ), 'blog' => array( 'default'=> esc_html__( 'Blog', 'parallaxsome' ), 'label'=> esc_html__( 'Our Blog', 'parallaxsome' ) ), 'clients' => array( 'default'=> esc_html( '', 'parallaxsome' ), 'label'=> esc_html__( 'Our Clients', 'parallaxsome' ) ), 'contact' => array( 'default'=> esc_html__( 'Contact', 'parallaxsome' ), 'label'=> esc_html__( 'Contact Us', 'parallaxsome' ) ) ); /*------------------------------------------------------------------------------------------------------------------*/ if( ! function_exists( 'parallaxsome_parallax_menu_cb' ) ): /** * Define the Parallax Menu Tab * * @param string * @return HTML * @since 1.0.0 */ function parallaxsome_parallax_menu_cb() { global $parallaxsome_single_menu_fields; $parallax_menu_type = get_theme_mod( 'parallax_menu_type', 'default' ); foreach ( $parallaxsome_single_menu_fields as $section_id => $section_value ) { $parallaxsome_menu_mod_id = $section_id.'_menu_title'; $parallaxsome_menu_mod_default = $section_value['default']; $parallaxsome_menu_title = get_theme_mod( $parallaxsome_menu_mod_id, $parallaxsome_menu_mod_default ); if( !empty( $parallaxsome_menu_title ) ) { $parallaxsome_menu_tab = ''; $parallaxsome_menu_tab .= '
  • '; if( $parallax_menu_type == 'float' ) { $parallaxsome_menu_tab .= ''; $parallaxsome_menu_tab .= '
    '. esc_attr( $parallaxsome_menu_title ) .'
    '; } else { $parallaxsome_menu_tab .= ''. esc_attr( $parallaxsome_menu_title ) .''; } $parallaxsome_menu_tab .= '
  • '; echo $parallaxsome_menu_tab; } } } endif; add_action( 'parallaxsome_parallax_menu', 'parallaxsome_parallax_menu_cb', 10 ); /*------------------------------------------------------------------------------------------------------------------*/ /** * Primary menu section * */ if( ! function_exists( 'parallaxsome_main_menu_hook' ) ): function parallaxsome_main_menu_hook() { $parallaxsome_menu_style = get_theme_mod( 'primary_menu_type', 'parallax' ); $parallax_menu_type = get_theme_mod( 'parallax_menu_type', 'default' ); if( $parallax_menu_type == 'float' ) { $nav_class = 'ps-floating-menu'; } else { $nav_class = 'ps-parallax-menu'; } ?>
    $ps_slider_cat_id, 'posts_per_page' => 5 ); $ps_slider_query = new WP_Query( $ps_slider_args ); if( $ps_slider_query->have_posts() ) { echo '
    ', '' ); the_archive_description( '
    ', '
    ' ); } elseif( is_single() && 'post' === get_post_type() ) { $post_category = get_the_category(); $first_cat_name = $post_category[0]->name; echo '

    '. $first_cat_name .'

    '; } elseif( is_page() ) { the_title( '

    ', '

    ' ); } elseif( is_search() ) { ?>

    ' . get_search_query() . '' ); ?>

    slug] = $categories->name; } /*------------------------------------------------------------------------------------------------------------------*/ /** * Changed excerpt more * * @since 1.0.0 */ add_filter( 'excerpt_more', 'parallaxsome_custom_excerpt_more' ); if( ! function_exists( 'parallaxsome_custom_excerpt_more' ) ): function parallaxsome_custom_excerpt_more( $more ) { return ' '; } endif; /*------------------------------------------------------------------------------------------------------------------*/ /** * Function define about page/post/archive sidebar * * @since 1.0.0 */ if( ! function_exists( 'parallaxsome_get_sidebar' ) ): function parallaxsome_get_sidebar() { global $post; if( 'post' === get_post_type() ) { $sidebar_meta_option = get_post_meta( $post->ID, 'ps_post_sidebar_layout', true ); } if( 'page' === get_post_type() ) { $sidebar_meta_option = get_post_meta( $post->ID, 'ps_page_sidebar_layout', true ); } if( is_home() ) { $set_id = get_option( 'page_for_posts' ); $sidebar_meta_option = get_post_meta( $set_id, 'ps_page_sidebar_layout', true ); } if( empty( $sidebar_meta_option ) || is_archive() || is_search() ) { $sidebar_meta_option = 'default_sidebar_layout'; } $archive_sidebar = get_theme_mod( 'ps_archive_sidebar_layout', 'right_sidebar' ); $post_default_sidebar = get_theme_mod( 'ps_default_post_sidebar', 'right_sidebar' ); $page_default_sidebar = get_theme_mod( 'ps_default_page_sidebar', 'right_sidebar' ); if( $sidebar_meta_option == 'default_sidebar_layout' ) { if( is_single() ) { if( $post_default_sidebar == 'right_sidebar' ) { get_sidebar(); } elseif( $post_default_sidebar == 'left_sidebar' ) { get_sidebar( 'left' ); } } elseif( is_page() ) { if( $page_default_sidebar == 'right_sidebar' ) { get_sidebar(); } elseif( $page_default_sidebar == 'left_sidebar' ) { get_sidebar( 'left' ); } } elseif( $archive_sidebar == 'right_sidebar' ) { get_sidebar(); } elseif( $archive_sidebar == 'left_sidebar' ) { get_sidebar( 'left' ); } } elseif( $sidebar_meta_option == 'right_sidebar' ) { get_sidebar(); } elseif( $sidebar_meta_option == 'left_sidebar' ) { get_sidebar( 'left' ); } } endif; /** * Remove the title prefix from archive pages * * @since 1.0.0 */ add_filter( 'get_the_archive_title', function ($title) { if ( is_category() ) { $title = single_cat_title( '', false ); } elseif ( is_tag() ) { $title = single_tag_title( '', false ); } elseif ( is_author() ) { $title = '' . get_the_author() . '' ; } return $title; });