tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* Add theme support for custom backgrounds. */ add_theme_support('custom-background'); /* * Enable support for Post Thumbnails on posts and pages. * * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ */ add_theme_support( 'post-thumbnails' ); /* Set custom thumbnail dimensions */ set_post_thumbnail_size( 125, 125, true ); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'neo-trendy-menu-masthead' => __( 'Main Menu', 'neo-trendy' ), ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); /* Add support for custom menus. */ add_theme_support( 'menus' ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style( 'editor-style.css' ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'neo_trendy_custom_background_args', array( 'default-color' => '00871d', 'default-attachment' => 'fixed', 'default-image' => '', ) ) ); /* * Enable support for Post Formats. * * See: https://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat' ) ); } endif; // neo_trendy_setup add_action( 'after_setup_theme', 'neo_trendy_setup' ); //Adding backwards compatibility for title-tag less than WordPress version 4.1 if ( ! function_exists( '_wp_render_title_tag' ) ) : function neo_trendy_render_title() { ?> <?php wp_title( '|', true, 'right' ); ?> __('Sidebar', 'neo-trendy'), 'id' => 'sidebar', 'description' => __('This is the widgetized sidebar.', 'neo-trendy'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); } add_action( 'widgets_init', 'neo_trendy_widgets_init' ); function neo_trendy_load_scripts() { /* Enqueue custom Javascript here using wp_enqueue_script(). */ /* Load the comment reply JavaScript. */ if ( is_singular() && get_option( 'thread_comments' ) && comments_open() ) wp_enqueue_script( 'comment-reply' ); } /* Dynamic Copyright Date */ function neo_trendy_copyright() { global $wpdb; $copyright_dates = $wpdb->get_results(" SELECT YEAR(min(post_date_gmt)) AS firstdate, YEAR(max(post_date_gmt)) AS lastdate FROM $wpdb->posts WHERE post_status = 'publish' "); $output = ''; if($copyright_dates) { $copyright = "© " . $copyright_dates[0]->firstdate; if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) { $copyright .= '-' . $copyright_dates[0]->lastdate; } $output = $copyright; } return $output; } // enable threaded comments function neo_trendy_enable_threaded_comments(){ if (!is_admin()) { if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) wp_enqueue_script('comment-reply'); } } add_action('wp_enqueue_scripts', 'neo_trendy_enable_threaded_comments'); /** * Enqueue scripts and styles */ function neo_trendy_scripts() { wp_enqueue_style( 'neo-trendy-style', get_stylesheet_uri() ); } add_action( 'wp_enqueue_scripts', 'neo_trendy_scripts' ); /** * Implement Custom neo_trendy Functions */ require( get_template_directory() . '/functions/neo-trendy-custom.php' ); /** * Implement the Custom Header feature */ require( get_template_directory() . '/inc/custom-header.php' ); ?>