__( 'Top Menu', 'eleganto' ), 'footer_menu' => __( 'Footer Menu', 'eleganto' ), ) ); // Add support for a featured image and the size add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 300, 300, true ); add_image_size( 'eleganto-home', 400, 300, true ); add_image_size( 'eleganto-square', 400, 400, true ); add_image_size( 'eleganto-single', 1600, 400, true ); // Add Custom logo Support add_theme_support( 'custom-logo', array( 'height' => 70, 'width' => 240, 'flex-height' => true, 'flex-width' => true, ) ); // Add Custom Background Support $args = array( 'default-color' => '222222', ); add_theme_support( 'custom-background', $args ); // Adds RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); // WooCommerce support add_theme_support( 'woocommerce' ); } endif; //////////////////////////////////////////////////////////////////// // Enqueue Styles (normal style.css and bootstrap.css) //////////////////////////////////////////////////////////////////// function eleganto_theme_stylesheets() { wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '3.3.6', 'all' ); wp_enqueue_style( 'eleganto-stylesheet', get_stylesheet_uri(), array(), '1.2.1', 'all' ); // load Font Awesome css wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.7.0', 'all' ); wp_enqueue_style( 'flexslider', get_template_directory_uri() . '/css/flexslider.css', array(), '2.6.0', 'all' ); wp_enqueue_style( 'eleganto-portfolio-css', get_template_directory_uri() . '/css/portfolio.css', array(), '1', 'all' ); } add_action( 'wp_enqueue_scripts', 'eleganto_theme_stylesheets' ); //////////////////////////////////////////////////////////////////// // Register Bootstrap JS with jquery //////////////////////////////////////////////////////////////////// function eleganto_theme_js() { wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.6', true ); wp_enqueue_script( 'eleganto-theme-js', get_template_directory_uri() . '/js/customscript.js', array( 'jquery' ), '1.2.1', true ); wp_enqueue_script( 'eleganto-menu-sticky', get_template_directory_uri() . '/js/sticky-menu.js', array( 'jquery' ), '1', true ); wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array( 'jquery' ), '2.6.1', true ); if ( post_type_exists( 'portfolio' ) ) { wp_enqueue_script( 'isotope', get_template_directory_uri() . '/js/isotope.pkgd.min.js', array( 'jquery' ), '3.0.1', true ); wp_enqueue_script( 'imagesLoaded', get_template_directory_uri() . '/js/imagesloaded.pkgd.min.js', array( 'jquery' ), '4.4.1', true ); } wp_enqueue_script( 'smooothscroll', get_template_directory_uri() . '/js/jquery.imageScroll.min.js', array( 'jquery' ), '0.2.3', true ); } add_action( 'wp_enqueue_scripts', 'eleganto_theme_js' ); //////////////////////////////////////////////////////////////////// // Register Custom Navigation Walker include custom menu widget to use walkerclass //////////////////////////////////////////////////////////////////// require_once( trailingslashit( get_template_directory() ) . 'lib/wp_bootstrap_navwalker.php' ); //////////////////////////////////////////////////////////////////// // Theme Info page //////////////////////////////////////////////////////////////////// if ( is_admin() && !is_child_theme() ) { include_once(trailingslashit( get_template_directory() ) . 'lib/welcome/welcome-screen.php'); } //////////////////////////////////////////////////////////////////// // Register the Sidebar(s) //////////////////////////////////////////////////////////////////// add_action( 'widgets_init', 'eleganto_widgets_init' ); function eleganto_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'eleganto' ), 'id' => 'eleganto-right-sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Left Sidebar', 'eleganto' ), 'id' => 'eleganto-left-sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } //////////////////////////////////////////////////////////////////// // Register hook and action to set Main content area col-md- width based on sidebar declarations //////////////////////////////////////////////////////////////////// add_action( 'eleganto_main_content_width_hook', 'eleganto_main_content_width_columns' ); function eleganto_main_content_width_columns() { $columns = '12'; if ( get_theme_mod( 'rigth-sidebar-check', 1 ) != 0 ) { $columns = $columns - absint( get_theme_mod( 'right-sidebar-size', 3 ) ); } if ( get_theme_mod( 'left-sidebar-check', 0 ) != 0 ) { $columns = $columns - absint( get_theme_mod( 'left-sidebar-size', 3 ) ); } echo $columns; } function eleganto_main_content_width() { do_action( 'eleganto_main_content_width_hook' ); } //////////////////////////////////////////////////////////////////// // Breadcrumbs //////////////////////////////////////////////////////////////////// if ( !function_exists( 'eleganto_breadcrumb' ) ) : function eleganto_breadcrumb() { global $post, $wp_query; $home = esc_html__( 'Home', 'eleganto' ); $delimiter = ' » '; $homeLink = home_url(); if ( is_home() || is_front_page() ) { // no need for breadcrumbs in homepage } else { echo ''; } } endif; //////////////////////////////////////////////////////////////////// // Social links //////////////////////////////////////////////////////////////////// if ( !function_exists( 'eleganto_social_links' ) ) : function eleganto_social_links() { $twp_social_links = array( 'twp_social_facebook' => 'Facebook', 'twp_social_twitter' => 'Twitter', 'twp_social_google' => 'Google-Plus', 'twp_social_instagram' => 'Instagram', 'twp_social_pin' => 'Pinterest', 'twp_social_youtube' => 'YouTube', 'twp_social_reddit' => 'Reddit', ); ?> ' . $strArray[ 1 ] . '', $myString ); } else { $post_slug = get_the_title(); } echo $post_slug; } endif;