__( 'Primary Menu', 'diaz' ), 'social_menu' => __( 'Social Menu', 'diaz' ) )); /* Load editor style ------------------------------------------------------------------------------*/ add_editor_style( 'custom-editor-style.css' ); /* Load text domain ------------------------------------------------------------------------------*/ load_theme_textdomain( 'diaz', get_template_directory_uri() . "/languages/" ); /* Add various theme support options ----------------------------------------------------------------------------- */ add_theme_support( 'automatic-feed-links' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) ); add_theme_support( "title-tag" ); add_post_type_support( 'page', 'excerpt' ); /* Jetpack ----------------------------------------------------------------------------- */ /* Infinite Scroll Support */ add_theme_support( 'infinite-scroll', array( 'container' => 'posts-wrapper', 'footer' => 'primary-footer', )); // Remove default social share functionality function themeora_jptweak_remove_share() { remove_filter( 'the_content', 'sharing_display',19 ); remove_filter( 'the_excerpt', 'sharing_display',19 ); if ( class_exists( 'Jetpack_Likes' ) ) { remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 ); } } add_action( 'loop_start', 'themeora_jptweak_remove_share' ); /* Custom header ----------------------------------------------------------------------------- */ $defaults = array( 'default-image' => '', 'random-default' => false, 'width' => 0, 'height' => 0, 'flex-height' => false, 'flex-width' => false, 'default-text-color' => '', 'header-text' => true, 'uploads' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support( 'custom-header', $defaults ); /* Setup the post thumbnail size for the theme. ------------------------------------------------------------------------------ */ set_post_thumbnail_size( 1140, 700, true ); //this is wide enough for 12 cols of the bootstrap grid system /* add custom image sizes */ add_image_size( 'themeora-thumbnail-span-2', 170, 110, true ); //spans 2 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-3', 270, 174, true ); //spans 3 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-4', 370, 239, true ); //spans 4 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-5', 470, 304, true ); //spans 5 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-6', 570, 369, true ); //spans 6 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-7', 670, 434, true ); //spans 7 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-8', 770, 498, true ); //spans 8 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-9', 870, 563, true ); //spans 9 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-10', 970, 628, true ); //spans 10 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-11', 1070, 692, true ); //spans 11 cols of the bootstrap grid add_image_size( 'themeora-thumbnail-span-12', 1170, 757, true ); //spans 12 cols of the bootstrap grid /* portfolio sizes */ /* 2 col layout */ add_image_size( 'themeora-portfolio-2col', 1170, 1000, true ); //spans 6 cols of the bootstrap grid add_image_size( 'themeora-portfolio-2col-fixed', 640, 547 ); // used for 2 col fixed width layout - does not need to be so wide add_image_size( 'themeora-portfolio-2col-masonry', 1170, 9999 ); // used for 6 col masonry layout - unlimited height and 585px wide add_image_size( 'themeora-portfolio-2col-masonry-fixed', 640, 9999 ); // used for 6 col masonry fixed layout /* 3 col layout */ add_image_size( 'themeora-portfolio-3col', 650, 550, true ); //spans 4 cols of the bootstrap grid add_image_size( 'themeora-portfolio-3col-wide', 1300, 550, true ); // double the 9 cols layout for the wider grid add_image_size( 'themeora-portfolio-3col-masonry', 650, 9999 ); // used for 3 col masonry layout - unlimited height and 390px wide add_image_size( 'themeora-portfolio-3col-masonry-fixed', 430, 9999 ); // used for 3 col masonry fixed layout add_image_size( 'themeora-portfolio-3col-fixed', 430, 362 ); // used for 3 col fixed width layout - does not need to be so wide /* 4 col layout */ add_image_size( 'themeora-portfolio-4col', 584, 500, true ); //spans 3 cols of the bootstrap grid add_image_size( 'themeora-portfolio-4col-wide', 1170, 500, true ); // double the 3 cols layout for the wider grid add_image_size( 'themeora-portfolio-4col-masonry', 584, 9999 ); // used for 3 col masonry layout - unlimited height and 390px wide add_image_size( 'themeora-portfolio-4col-masonry-fixed', 320, 9999 ); // used for 3 col masonry fixed layout add_image_size( 'themeora-portfolio-4col-fixed', 320, 301, true ); //spans 3 cols of the bootstrap grid } endif; //themeora_theme_setup add_action('after_setup_theme', 'themeora_theme_setup'); /* Add a custom size to image editor ------------------------------------------------------------------------------- */ //Add a custom size for large images in single posts that expand past the post content area add_image_size( 'themeora-post-stretch', 1090, 705, true); add_filter( 'image_size_names_choose', 'themeora_custom_sizes' ); function themeora_custom_sizes( $sizes ) { return array_merge( $sizes, array( 'themeora-post-stretch' => __( 'Full width Stretched', 'diaz' ), ) ); } /* The main init functions * register/enqueue theme scripts, nav areas, and widget areas. ------------------------------------------------------------------------------- */ if ( ! function_exists( 'themeora_enqueue_scripts' ) ) : function themeora_enqueue_scripts() { /* Styles */ wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css' ); wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css' ); wp_enqueue_style( 'animate', get_template_directory_uri() . '/css/animate.min.css' ); wp_enqueue_style( 'diaz-base-style', get_stylesheet_uri() ); //the essential stylesheet required for the theme to be recognised // Add styling options from customizer $diaz_user_css = themeora_customizer_css(); wp_add_inline_style( 'diaz-base-style', $diaz_user_css ); /* Scripts */ wp_enqueue_script( 'modernizer', get_template_directory_uri() . '/js/modernizr.custom.js', false, null, true); wp_enqueue_script( 'classie', get_template_directory_uri() . '/js/classie.js', array( 'jquery' ), null, true); wp_enqueue_script( 'anim-on-scroll', get_template_directory_uri() . '/js/AnimOnScroll.js', false, null, true); wp_enqueue_script( 'pace', get_template_directory_uri() . '/js/pace.min.js', false, null, true); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // Register the main js file wp_enqueue_script( 'diaz-custom', get_template_directory_uri() . '/js/custom.js', array('jquery','imagesloaded','masonry','hoverIntent'), null, true ); } endif; // themeora_enqeue_scripts add_action( 'wp_enqueue_scripts', 'themeora_enqueue_scripts' ); /* Load third party fonts ------------------------------------------------------------------------------- */ /* Register Google Fonts */ function themeora_google_fonts_url() { $font_url = ''; /* Translators: If there are characters in your language that are not supported by chosen font(s), translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Google font: on or off', 'diaz' ) ) { $font_url = add_query_arg( 'family', urlencode( 'Hind:400,300,500,700|Open Sans:400,700' ), "//fonts.googleapis.com/css" ); } return $font_url; } /* Enqueue google fonts for theme */ function themeora_google_fonts() { wp_enqueue_style( 'themeora-google-fonts', themeora_google_fonts_url(), array(), '1.0.0' ); } add_action( 'wp_enqueue_scripts', 'themeora_google_fonts' ); /* Add font to custom editor */ function themeora_editor_styles() { add_editor_style( array( 'custom-editor-style.css', themeora_google_fonts_url() ) ); } add_action( 'after_setup_theme', 'themeora_editor_styles' ); if ( ! function_exists( 'themeora_widgets_init' ) ) : /* The function to register sidebars & widgets ------------------------------------------------------------------------------- */ function themeora_widgets_init() { register_sidebar( array( 'name' => __( 'Blog Sidebar', 'diaz' ), 'id' => 'blog-sidebar', 'description' => __( 'Default blog sidebar stuff', 'diaz' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => __( 'Page Sidebar', 'diaz' ), 'id' => 'page-sidebar', 'description' => __( 'Default page sidebar stuff', 'diaz' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => __( 'Footer widget', 'diaz' ), 'id' => 'footer-widget', 'description' => __( 'This is the widget for the footer', 'diaz' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } endif; //themeora_widgets_init add_action( 'widgets_init', 'themeora_widgets_init' ); /* ----------------------- end main init function ----------------------------- */ /* Load theme functions ------------------------------------------------------------------------------ */ if ( file_exists( get_template_directory(). '/inc/functions-utility.php') ) { include_once ( get_template_directory(). '/inc/functions-utility.php' ); } if ( file_exists( get_template_directory(). '/inc/functions-templates.php') ) { include_once ( get_template_directory(). '/inc/functions-templates.php' ); }