tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); /* * 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' ); add_image_size( 'dandy-image-post' , 710, 410, true); add_image_size( 'dandy-single-image' , 1170, 450, true); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'primary' => esc_html__( 'Primary', 'dandy' ) ) ); /* * 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', ) ); /* * Enable support for Post Formats. * See https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support( 'post-formats', array( 'video', 'gallery', 'audio', ) ); //Logo upload customizer support add_theme_support( 'custom-logo', array( 'height' => 78, 'width' => 220, 'flex-width' => true, ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'dandy_custom_background_args', array( 'default-color' => 'e4e4e4', 'default-image' => '', ) ) ); } endif; add_action( 'after_setup_theme', 'dandy_setup' ); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function dandy_content_width() { $GLOBALS['content_width'] = apply_filters( 'dandy_content_width', 640 ); } add_action( 'after_setup_theme', 'dandy_content_width', 0 ); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function dandy_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'dandy' ), 'id' => 'sidebar-1', 'description' => '', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 1', 'dandy' ), 'id' => 'footer-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 2', 'dandy' ), 'id' => 'footer-2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer 3', 'dandy' ), 'id' => 'footer-3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'dandy_widgets_init' ); /** * Enqueue scripts and styles. */ function dandy_scripts() { wp_enqueue_style( 'dandy-style', get_stylesheet_uri() ); wp_enqueue_style( 'font-awesome', get_template_directory_uri() .'/css/font-awesome.min.css'); $query_args = array( 'family' => 'Open-Sans:300,400,700|Montserrat:300,400,700' ); wp_register_style( 'dandy-googlefonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null ); wp_enqueue_style( 'dandy-googlefonts' ); wp_enqueue_script( 'dandy-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); wp_enqueue_script( 'dandy-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); wp_enqueue_script( 'dandy-custom', get_template_directory_uri() . '/js/jquery.dandy.js', array('jquery', 'jquery-masonry'), '1.0', true ); wp_enqueue_script( 'dandy-newsTicker', get_template_directory_uri() . '/js/jquery.newsTicker.min.js', array('jquery'), '1.0', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'dandy_scripts' ); /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.php'; /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php'; /** * Load Pro Button */ require_once( trailingslashit( get_template_directory() ) . 'inc/pro-button/class-customize.php' ); /** * Replaces the excerpt "more" text by a link */ if ( ! function_exists( ' dandy_new_excerpt_more' ) ) { function dandy_new_excerpt_more( $more ) { return '…'; } } add_filter('excerpt_more', 'dandy_new_excerpt_more'); /** * Delete font size style from tag cloud widget */ if ( ! function_exists( 'dandy_fix_tag_cloud' ) ) { function dandy_fix_tag_cloud($tag_string){ return preg_replace('/ style=("|\')(.*?)("|\')/','',$tag_string); } } add_filter('wp_generate_tag_cloud', 'dandy_fix_tag_cloud',10,1); /** * Backwards Compatibility for wp_body_open() function in WP 5.2 */ if ( ! function_exists( 'wp_body_open' ) ) { function wp_body_open() { do_action( 'wp_body_open' ); } } /** * Admin Page */ if ( is_admin() ) { require get_template_directory() . '/inc/admin/dandy-admin-page.php'; } /** * BREADCRUMBS */ if ( ! function_exists( 'dandy_breadcrumb' ) ) : function dandy_breadcrumb() { /* === OPTIONS === */ $text['home'] = ''.__('Home', 'dandy'); // text for the 'Home' link $text['category'] = __('Category %s', 'dandy'); // text for a category page $text['search'] = __('Results for %s', 'dandy'); // text for a search results page $text['tag'] = __('Tag %s', 'dandy'); // text for a tag page $text['author'] = __('Author %s', 'dandy'); // text for an author page $text['404'] = __('Error 404', 'dandy'); // text for the 404 page $show_current = 1; // 1 - show current post/page/category title in breadcrumbs, 0 - don't show $show_on_home = 1; // 1 - show breadcrumbs on the homepage, 0 - don't show $show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show $show_title = 1; // 1 - show the title for the links, 0 - don't show $delimiter = ''; // delimiter between crumbs $before = ''; // tag before the current crumb $after = ''; // tag after the current crumb /* === END OF OPTIONS === */ global $post; $home_link = esc_url(home_url('/')); $link_before = ''; $link_after = ''; $link_attr = ' rel="v:url" property="v:title"'; $link = $link_before . '%2$s' . $link_after; $parent_id = $parent_id_2 = $post->post_parent; $frontpage_id = get_option('page_on_front'); echo '
'; if (is_home() || is_front_page()) { if ($show_on_home == 1) echo ''; } else { echo ''; } echo '
'; } endif;