__( 'Main Menu', 'amigo' ), ) ); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 300, 300, true ); add_image_size( 'amigo-home', 476, 634, true ); add_image_size( 'amigo-slider', 765, 430, true ); add_image_size( 'amigo-single', 1170, 400, true ); // Adds RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); // Add Custom Background Support $args = array( 'default-color' => '424242', ); add_theme_support( 'custom-background', $args ); // Set Content Width if ( !isset( $content_width ) ) $content_width = 800; // Enable support for Post Formats. add_theme_support( 'post-formats', array( 'video', 'gallery' ) ); } endif; //////////////////////////////////////////////////////////////////// // Enqueue Styles (normal style.css and bootstrap.css) //////////////////////////////////////////////////////////////////// function amigo_theme_stylesheets() { wp_enqueue_style( 'amigo-bootstrap-css', get_template_directory_uri() . '/css/bootstrap.css' ); wp_enqueue_style( 'amigo-stylesheet', get_stylesheet_uri() ); // load Font Awesome css wp_enqueue_style( 'amigo-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', false ); // load Flexslider css wp_enqueue_style( 'amigo-stylesheet-flexslider', get_template_directory_uri() . '/css/flexslider.css', 'style' ); } add_action( 'wp_enqueue_scripts', 'amigo_theme_stylesheets' ); //////////////////////////////////////////////////////////////////// // Register Bootstrap JS with jquery //////////////////////////////////////////////////////////////////// function amigo_theme_js() { wp_enqueue_script( 'amigo-bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ) ); wp_enqueue_script( 'amigo-theme-js', get_template_directory_uri() . '/js/customscript.js', array( 'jquery' ) ); wp_enqueue_script( 'amigo-flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array( 'jquery' ) ); } add_action( 'wp_enqueue_scripts', 'amigo_theme_js' ); //////////////////////////////////////////////////////////////////// // Register Custom Navigation Walker include custom menu widget to use walkerclass //////////////////////////////////////////////////////////////////// require_once('lib/wp_bootstrap_navwalker.php'); //////////////////////////////////////////////////////////////////// // Register the Sidebar(s) //////////////////////////////////////////////////////////////////// add_action( 'widgets_init', 'amigo_widgets_init' ); function amigo_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'amigo' ), 'id' => 'amigo-right-sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

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

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Area After First Post', 'amigo' ), 'id' => 'amigo-post-area', 'description' => __( 'Suitable for text widget.', 'amigo' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } //////////////////////////////////////////////////////////////////// // Register hook and action to set Main content area col-md- width based on sidebar declarations //////////////////////////////////////////////////////////////////// add_action( 'amigo_main_content_width_hook', 'amigo_main_content_width_columns' ); function amigo_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 amigo_main_content_width() { do_action( 'amigo_main_content_width_hook' ); } //////////////////////////////////////////////////////////////////// // Breadcrumbs //////////////////////////////////////////////////////////////////// function amigo_breadcrumb() { global $post, $wp_query; $home = __( 'Home', 'amigo' ); $delimiter = ' / '; $homeLink = home_url(); if ( is_home() || is_front_page() ) { // no need for breadcrumbs in homepage } else { echo ''; } } //////////////////////////////////////////////////////////////////// // Social links //////////////////////////////////////////////////////////////////// if ( !function_exists( 'amigo_social_links' ) ) : /** * This function is for social links display on header * * Get links through Theme Options */ function amigo_social_links() { $twp_social_links = array( 'twp_social_facebook' => __( 'Facebook', 'amigo' ), 'twp_social_twitter' => __( 'Twitter', 'amigo' ), 'twp_social_google' => __( 'Google-Plus', 'amigo' ), 'twp_social_instagram' => __( 'Instagram', 'amigo' ), 'twp_social_pin' => __( 'Pinterest', 'amigo' ), 'twp_social_youtube' => __( 'YouTube', 'amigo' ), 'twp_social_reddit' => __( 'Reddit', 'amigo' ), ); ?> ' . esc_attr( $userTotal ) . ''; } } } function amigo_review_show_total( $echo = true, $class = 'review-total-only', $post_id = null, $args = array() ) { global $post, $wp_review_rating_types; if ( empty( $post_id ) ) $post_id = $post->ID; $type = wp_review_get_post_review_type( $post_id ); $user_type = wp_review_get_post_user_review_type( $post_id ); if ( !$type && !$user_type ) return ''; wp_enqueue_style( 'wp_review-style' ); $options = get_option( 'wp_review_options' ); $show_on_thumbnails_type = isset( $options[ 'show_on_thumbnails_type' ] ) ? $options[ 'show_on_thumbnails_type' ] : 'visitors'; $show_on_thumbnails_type = apply_filters( 'wp_review_thumbnails_total', $show_on_thumbnails_type, $post_id, $args ); // will override option $total = get_post_meta( $post_id, 'wp_review_user_reviews', true ); if ( $user_type == 'point' || $user_type == 'percentage' ) { $rating = sprintf( $wp_review_rating_types[ $user_type ][ 'value_text' ], $total ); } else { $rating = wp_review_user_rating( $post_id ); } $review = ''; if ( !empty( $rating ) && !empty( $total ) ) { $review .= '
'; $review .= $rating; $review .= '
'; } $review = apply_filters( 'wp_review_show_total', $review, $post_id, $type, $total ); $review = apply_filters( 'wp_review_total_output', $review, $post_id, $type, $total, $class, $args ); if ( $echo ) echo $review; else return $review; }