400, 'width' => 240, 'flex-height' => true, 'flex-width' => true, ) ); /* * Enable support for custom menus. */ register_nav_menus( array( 'main-menu' => esc_html__( 'Main Menu', 'organic-horizon' ), 'social-menu' => esc_html__( 'Social Menu', 'organic-horizon' ), )); /* * Enable support for custom header. */ register_default_headers( array( 'default' => array( 'url' => get_template_directory_uri() . '/images/default-header.jpg', 'thumbnail_url' => get_template_directory_uri() . '/images/default-header.jpg', 'description' => esc_html__( 'Default Custom Header', 'organic-horizon' ), ), )); $defaults = array( 'video' => true, 'width' => 1800, 'height' => 480, 'flex-height' => true, 'flex-width' => true, 'default-image' => get_template_directory_uri() . '/images/default-header.jpg', 'header-text' => false, 'uploads' => true, ); add_theme_support( 'custom-header', $defaults ); /* * Enable support for custom background. */ $defaults = array( 'default-color' => 'f4f4f4', ); add_theme_support( 'custom-background', $defaults ); } endif; // End function organic_horizon_setup. add_action( 'after_setup_theme', 'organic_horizon_setup' ); /* ------------------------------------------------------------------------------------------------------- Register Scripts ------------------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'organic_horizon_enqueue_scripts' ) ) { /** Function organic_horizon_enqueue_scripts */ function organic_horizon_enqueue_scripts() { // Enqueue Styles. wp_enqueue_style( 'organic-horizon-style', get_stylesheet_uri() ); wp_enqueue_style( 'organic-horizon-style-conditionals', get_template_directory_uri() . '/css/style-conditionals.css', array( 'organic-horizon-style' ), '1.0' ); wp_enqueue_style( 'organic-horizon-style-mobile', get_template_directory_uri() . '/css/style-mobile.css', array( 'organic-horizon-style' ), '1.0' ); wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.css', array( 'organic-horizon-style' ), '1.0' ); // Resgister Scripts. wp_register_script( 'jquery-sidr', get_template_directory_uri() . '/js/jquery.sidr.js', array( 'jquery' ), '1.0' ); wp_register_script( 'jquery-fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', array( 'jquery' ), '1.0' ); wp_register_script( 'jquery-brightness', get_template_directory_uri() . '/js/jquery.bgBrightness.js', array( 'jquery' ), '1.0' ); wp_register_script( 'jquery-mousewheel', get_template_directory_uri() . '/js/jquery.mousewheel.js', array( 'jquery' ), '1.0' ); // Enqueue Scripts. wp_enqueue_script( 'hoverIntent' ); wp_enqueue_script( 'organic-horizon-custom', get_template_directory_uri() . '/js/jquery.custom.js', array( 'jquery', 'jquery-sidr', 'jquery-mousewheel', 'jquery-fitvids', 'jquery-brightness' ), '1.0', true ); // Load single scripts only on single pages. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } } add_action( 'wp_enqueue_scripts', 'organic_horizon_enqueue_scripts' ); /* ------------------------------------------------------------------------------------------------------- Theme Updater ------------------------------------------------------------------------------------------------------- */ /** Function organic_horizon_theme_updater */ function organic_horizon_theme_updater() { require( get_template_directory() . '/updater/theme-updater.php' ); } add_action( 'after_setup_theme', 'organic_horizon_theme_updater' ); /* ------------------------------------------------------------------------------------------------------- Category ID to Name ------------------------------------------------------------------------------------------------------- */ /** * Changes category IDs to names. * * @param array $id IDs for categories. * @return array */ if ( ! function_exists( 'organic_horizon_cat_id_to_name' ) ) : function organic_horizon_cat_id_to_name( $id ) { $cat = get_category( $id ); if ( is_wp_error( $cat ) ) { return false; } return $cat->cat_name; } endif; /* ------------------------------------------------------------------------------------------------------- Posted On Function ------------------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'organic_horizon_posted_on' ) ) : /** Function organic_horizon_posted_on */ function organic_horizon_posted_on() { if ( get_the_modified_time() != get_the_time() ) { printf( __( 'Updated: %2$s', 'organic-horizon' ), 'meta-prep meta-prep-author', sprintf( '%3$s', esc_url( get_permalink() ), esc_attr( get_the_modified_time() ), esc_attr( get_the_modified_date() ) ) ); } else { printf( __( 'Posted: %2$s', 'organic-horizon' ), 'meta-prep meta-prep-author', sprintf( '%3$s', esc_url( get_permalink() ), esc_attr( get_the_time() ), get_the_date() ) ); } } endif; /* ------------------------------------------------------------------------------------------------------ Content Width ------------------------------------------------------------------------------------------------------ */ if ( ! isset( $content_width ) ) { $content_width = 760; } if ( ! function_exists( 'organic_horizon_content_width' ) ) : /** Function organic_horizon_content_width */ function organic_horizon_content_width() { $GLOBALS['content_width'] = apply_filters( 'organic_horizon_content_width', 760 ); } endif; add_action( 'after_setup_theme', 'organic_horizon_content_width', 0 ); /* ------------------------------------------------------------------------------------------------------- Comments Function ------------------------------------------------------------------------------------------------------- */ if ( ! function_exists( 'organic_horizon_comment' ) ) : /** * Setup our comments for the theme. * * @param array $comment IDs for categories. * @param array $args Comment arguments. * @param array $depth Level of replies. */ function organic_horizon_comment( $comment, $args, $depth ) { switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
', '' ); ?>