to head. add_theme_support( 'title-tag' ); // Adds core WordPress HTML5 support. add_theme_support( 'html5', array( 'script', 'style', 'caption', 'comment-form', 'comment-list', 'gallery', 'search-form' ) ); // Add theme support for WordPress Custom Logo add_theme_support( 'custom-logo' ); // Add theme support for WordPress Custom Background add_theme_support( 'custom-background', array( 'default-color' => neux_default_style( 'site_background' ), 'default-image' => neux_default_style( 'site_background_image' ), 'default-repeat' => neux_default_style( 'site_background_repeat' ), 'default-position-x' => 'center', 'default-position-y' => 'top', 'default-size' => neux_default_style( 'site_background_size' ), 'default-attachment' => neux_default_style( 'site_background_attachment' ), ) ); // Add theme support for custom headers add_theme_support( 'custom-header', array( 'width' => 1380, 'height' => 500, 'flex-height' => true, 'flex-width' => true, 'default-image' => hoot_data()->template_uri . 'images/header.jpg', 'header-text' => false ) ); // Adds theme support for WordPress 'featured images'. add_theme_support( 'post-thumbnails' ); // Automatically add feed links to . add_theme_support( 'automatic-feed-links' ); // WordPress Jetpack add_theme_support( 'infinite-scroll', array( 'type' => apply_filters( 'neux_jetpack_infinitescroll_type', 'click' ), // scroll or click 'container' => apply_filters( 'neux_jetpack_infinitescroll_container', 'content' ), 'footer' => false, 'wrapper' => true, 'render' => apply_filters( 'neux_jetpack_infinitescroll_render', 'neux_jetpack_infinitescroll_render' ), ) ); /* === WooCommerce Plugin === */ // Woocommerce support and init load theme woo functions if ( class_exists( 'WooCommerce' ) ) { add_theme_support( 'woocommerce' ); if ( file_exists( hoot_data()->template_dir . 'woocommerce/functions.php' ) ) include_once( hoot_data()->template_dir . 'woocommerce/functions.php' ); } /** One click demo import **/ // Disable branding add_filter( 'pt-ocdi/disable_pt_branding', 'neux_disable_pt_branding' ); function neux_disable_pt_branding() { return true; } /* === Hootkit Plugin === */ // Load theme's Hootkit functions if plugin is active if ( class_exists( 'HootKit' ) && file_exists( hoot_data()->template_dir . 'hootkit/functions.php' ) ) include_once( hoot_data()->template_dir . 'hootkit/functions.php' ); /* === Tribe The Events Calendar Plugin === */ // Load support if plugin active if ( class_exists( 'Tribe__Events__Main' ) ) { // Hook into 'wp' to use conditional hooks add_action( 'wp', 'neux_tribeevent', 10 ); // Add hooks based on view // @since 2.7.3 function neux_tribeevent() { if ( is_post_type_archive( 'tribe_events' ) || ( function_exists( 'tribe_is_events_home' ) && tribe_is_events_home() ) ) { add_filter( 'theme_mod_archive_type', 'neux_tribeevent_archivetype', 5 ); add_filter( 'theme_mod_archive_post_content', 'neux_tribeevent_archive', 5 ); add_filter( 'theme_mod_archive_post_meta', 'neux_tribeevent_archive_postmeta', 5 ); add_action( 'neux_display_loop_meta', 'neux_tribeevent_loopmeta', 5 ); } if ( is_singular( 'tribe_events' ) ) { add_action( 'neux_display_loop_meta', 'neux_tribeevent_loopmeta_single', 5 ); } } // Modify theme options and displays // @since 2.7.3 function neux_tribeevent_archivetype( $type ) { return 'big'; } function neux_tribeevent_archive( $content ) { return 'full-content'; } function neux_tribeevent_archive_postmeta( $args ) { return ''; } function neux_tribeevent_loopmeta( $display ) { return false; } function neux_tribeevent_loopmeta_single( $display ) { the_post(); rewind_posts(); // Bug Fix return false; } } /* === Breadcrumb NavXT Plugin === */ // Load support if plugin active if ( class_exists( 'bcn_breadcrumb' ) ) { // Enclose pretext in span add_filter( 'bcn_widget_pretext', 'unos_bcn_pretext' ); // Enclose pretext in span // @since 2.7.3 function unos_bcn_pretext( $pretext ) { if ( empty( $pretext ) ) return ''; return '' . $pretext . ''; } } /* === Theme Hooks === */ /** * Handle content width for embeds and images. * Hooked into 'init' so that we can pull custom content width from theme options * * @since 1.0 * @return void */ function neux_set_content_width() { $width = intval( hoot_get_mod( 'site_width' ) ); $width = !empty( $width ) ? $width : 1260; $GLOBALS['content_width'] = absint( $width ); } add_action( 'init', 'neux_set_content_width', 10 ); /** * Modify the '[...]' Read More Text * * @since 1.0 * @return string */ function neux_readmoretext( $more ) { $read_more = esc_html( hoot_get_mod('read_more') ); /* Translators: %s is the HTML → symbol */ // $read_more = ( empty( $read_more ) ) ? sprintf( __( 'Continue Reading %s', 'neux' ), '→' ) : $read_more; $read_more = ( empty( $read_more ) ) ? __( 'Continue Reading', 'neux' ) : $read_more; return $read_more; } add_filter( 'hoot_readmoretext', 'neux_readmoretext' ); /** * Modify the exceprt length. * Make sure to set the priority correctly such as 999, else the default WordPress filter on this function will run last and override settng here. * * @since 1.0 * @return void */ function neux_custom_excerpt_length( $length ) { if ( is_admin() ) return $length; $excerpt_length = intval( hoot_get_mod('excerpt_length') ); if ( !empty( $excerpt_length ) ) return $excerpt_length; return 50; } add_filter( 'excerpt_length', 'neux_custom_excerpt_length', 999 ); /** * Register recommended plugins via TGMPA * * @since 1.0 * @return void */ function neux_tgmpa_plugins() { // Array of plugin arrays. Required keys are name and slug. // Since source is from the .org repo, it is not required. $plugins = apply_filters( 'neux_tgmpa_plugins', array( array( 'name' => __( '(HootKit) Neux Sliders, Widgets', 'neux' ), 'slug' => 'hootkit', 'required' => false, ), ) ); // Array of configuration settings. $config = array( 'is_automatic' => true, ); // Register plugins with TGM_Plugin_Activation class tgmpa( $plugins, $config ); } add_filter( 'tgmpa_register', 'neux_tgmpa_plugins' );