for posts and comments. add_theme_support( 'automatic-feed-links' ); // This theme supports custom background color and image. $defaults = array( 'default-color' => '', 'default-image' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $defaults ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 980, 9999 ); // This theme uses a custom header background image. $args = array( 'flex-width' => true, 'flex-height' => true, 'width' => 1800, 'default-image' => get_template_directory_uri() . '/images/header.jpg', 'header-text' => false, 'random-default' => true,); add_theme_support( 'custom-header', $args ); add_theme_support( 'woocommerce' ); global $content_width; if ( ! isset( $content_width ) ) { $content_width = 690; } } add_action( 'after_setup_theme', 'restimpo_setup' ); /** * Enqueues scripts and styles for front-end. * */ function restimpo_scripts_styles() { global $wp_styles, $wp_scripts; // Adds JavaScript if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); wp_enqueue_script( 'restimpo-placeholders', get_template_directory_uri() . '/js/placeholders.js', array(), '3.0.2', true ); wp_enqueue_script( 'restimpo-scroll-to-top', get_template_directory_uri() . '/js/scroll-to-top.js', array( 'jquery' ), '1.0', true ); wp_enqueue_script( 'restimpo-selectnav', get_template_directory_uri() . '/js/selectnav.js', array(), '0.1', true ); wp_enqueue_script( 'restimpo-responzive', get_template_directory_uri() . '/js/responzive.js', array(), '1.0', true ); wp_enqueue_script( 'restimpo-html5-ie', get_template_directory_uri() . '/js/html5.js', array(), '3.7', false ); $wp_scripts->add_data( 'restimpo-html5-ie', 'conditional', 'lt IE 9' ); // Loads the main stylesheet. wp_enqueue_style( 'restimpo-style', get_stylesheet_uri() ); if ( class_exists( 'woocommerce' ) ) { wp_enqueue_style( 'restimpo-woocommerce-custom', get_template_directory_uri() . '/css/woocommerce-custom.css' ); } // Loads additional stylesheet for IE8 and older versions. wp_enqueue_style( 'restimpo-style-ie', get_template_directory_uri() . '/css/style-ie.css' ); // Apply IE conditionals $GLOBALS['wp_styles']->add_data( 'restimpo-style-ie', 'conditional', 'lte IE 8' ); } add_action( 'wp_enqueue_scripts', 'restimpo_scripts_styles' ); /** * Creates a nicely formatted and more specific title element text. * */ function restimpo_wp_title( $title, $sep ) { if ( is_feed() ) return $title; $title .= get_bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title = "$title $sep $site_description"; return $title; } add_filter( 'wp_title', 'restimpo_wp_title', 10, 2 ); /** * Register our menus. * */ function restimpo_register_my_menus() { register_nav_menus( array( 'main-navigation' => __( 'Main Header Menu', 'restimpo' ), 'top-navigation' => __( 'Top Header Menu', 'restimpo' ) ) ); } add_action( 'after_setup_theme', 'restimpo_register_my_menus' ); /** * Register our sidebars and widgetized areas. * */ function restimpo_widgets_init() { register_sidebar( array( 'name' => __( 'Right Sidebar', 'restimpo' ), 'id' => 'sidebar-1', 'description' => __( 'Right sidebar which appears on all posts and pages.', 'restimpo' ), 'before_widget' => '', 'before_title' => ' ', ) ); register_sidebar( array( 'name' => __( 'Footer left widget area', 'restimpo' ), 'id' => 'sidebar-2', 'description' => __( 'Left column with widgets in footer.', 'restimpo' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => __( 'Footer middle widget area', 'restimpo' ), 'id' => 'sidebar-3', 'description' => __( 'Middle column with widgets in footer.', 'restimpo' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => __( 'Footer right widget area', 'restimpo' ), 'id' => 'sidebar-4', 'description' => __( 'Right column with widgets in footer.', 'restimpo' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'name' => __( 'Footer notices', 'restimpo' ), 'id' => 'sidebar-5', 'description' => __( 'The line for copyright and other notices below the footer widget areas. Insert here one Text widget. The "Title" field at this widget should stay empty.', 'restimpo' ), 'before_widget' => '', 'before_title' => '', 'after_title' => '', ) ); register_sidebar( array( 'name' => __( 'Latest Posts Homepage widget area', 'restimpo' ), 'id' => 'sidebar-6', 'description' => __( 'The area for any RestImpo Posts Widgets, which display latest posts from a specific category below the default Latest Posts area.', 'restimpo' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ) ); } add_action( 'widgets_init', 'restimpo_widgets_init' ); /** * Post excerpt settings. * */ function restimpo_custom_excerpt_length( $length ) { return 30; } add_filter( 'excerpt_length', 'restimpo_custom_excerpt_length', 20 ); function restimpo_new_excerpt_more( $more ) { global $post; return '... ' . __( 'Read more >', 'restimpo' ) . '';} add_filter( 'excerpt_more', 'restimpo_new_excerpt_more' ); if ( ! function_exists( 'restimpo_content_nav' ) ) : /** * Displays navigation to next/previous pages when applicable. * */ function restimpo_content_nav( $html_id ) { global $wp_query; $html_id = esc_attr( $html_id ); if ( $wp_query->max_num_pages > 1 ) : ?> comment_type ) : case 'pingback' : case 'trackback' : ?>
  • id="comment-">

    ', '' ); ?>

  • id="li-comment-">
    %1$s %2$s', get_comment_author_link(), ( $comment->user_id === $post->post_author ) ? '' . __( '(Post author)', 'restimpo' ) . '' : '' ); printf( '', esc_url( get_comment_link( $comment->comment_ID ) ), get_comment_time( 'c' ), // translators: 1: date, 2: time sprintf( __( '%1$s at %2$s', 'restimpo' ), get_comment_date(''), get_comment_time() ) ); ?>
    comment_approved ) : ?>

    __( 'Reply', 'restimpo' ), 'after' => ' ', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ', '

    ' ); ?>
    $object ) { if ( 0 == $object->menu_item_parent ) { $top_ids[$i] = $object; continue; } if ( ! in_array( $object->menu_item_parent, $ids ) ) { $objects[$i]->classes[] = 'first-menu-item'; $ids[] = $object->menu_item_parent; } if ( in_array( 'first-menu-item', $object->classes ) ) continue; $parent_ids[$i] = $object->menu_item_parent; } $sanitized_parent_ids = array_unique( array_reverse( $parent_ids, true ) ); foreach ( $sanitized_parent_ids as $i => $id ) $objects[$i]->classes[] = 'last-menu-item'; return $objects; } /** * WooCommerce custom template modifications. * */ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { function restimpo_woocommerce_modifications() { remove_action ( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); } add_action ( 'init', 'restimpo_woocommerce_modifications' ); add_filter ( 'woocommerce_show_page_title', '__return_false' ); } ?>