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. */ add_theme_support( 'post-thumbnails' ); /** * Add default posts and comments RSS feed links to head. */ add_theme_support( 'automatic-feed-links' ); /** * Add support for block styles. */ add_theme_support( 'wp-block-styles' ); /** * Add support for responsive embedded content. */ add_theme_support( 'responsive-embeds' ); /** * Add support for wide alignment for blocks. */ add_theme_support( 'align-wide' ); register_nav_menus( array( 'primary' => __( 'Primary Menu', 'brizy-starter' ), 'secondary' => __( 'Secondary Menu', 'brizy-starter' ), 'footer' => __( 'Footer Menu', 'brizy-starter' ) ) ); /** * 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 core custom logo. */ add_theme_support( 'custom-logo', array( 'height' => 150, 'width' => 150, 'flex-width' => true, 'flex-height' => true, ) ); /** * Add support for custom background. */ add_theme_support( 'custom-background', array( 'default-color' => 'ffffff', 'default-image' => '', ) ); /** * Add support for custom header. */ add_theme_support( 'custom-header', array( 'default-image' => '', 'default-text-color' => '000000', 'width' => 2000, 'height' => 250, 'flex-height' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ) ); } } add_action( 'after_setup_theme', 'brizy_starter_theme_setup' ); /** * Theme Scripts & Styles */ if ( ! function_exists( 'brizy_starter_theme_scripts_styles' ) ) { function brizy_starter_theme_scripts_styles() { wp_enqueue_style( 'brizy-starter-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } } add_action( 'wp_enqueue_scripts', 'brizy_starter_theme_scripts_styles' ); if ( ! function_exists( 'brizy_starter_theme_post_thumbnail' ) ) : /** * Displays post thumbnail. */ function brizy_starter_theme_post_thumbnail() { if ( is_singular() ) : ?>
%1$s%2$s', __( 'Posted in', 'brizy-starter' ), $categories_list ); } $tags_list = get_the_tag_list( '', __( ', ', 'brizy-starter' ) ); if ( $tags_list ) { printf( '%1$s %2$s', __( 'Tags:', 'brizy-starter' ), $tags_list ); } } // Comment count. if ( ! is_singular() ) { brizy_starter_theme_comment_count(); } } endif; if ( ! function_exists( 'brizy_starter_theme_posted_by' ) ) : /** * Prints HTML with meta information about theme author. */ function brizy_starter_theme_posted_by() { printf( '%1$s%3$s', __( 'Posted by', 'brizy-starter' ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_html( get_the_author() ) ); } endif; if ( ! function_exists( 'brizy_starter_theme_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time. */ function brizy_starter_theme_posted_on() { $time_string = ''; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date() ) ); printf( '%2$s', esc_url( get_permalink() ), $time_string ); } endif; if ( ! function_exists( 'brizy_starter_theme_comment_count' ) ) : /** * Prints HTML with the comment count for the current post. */ function brizy_starter_theme_comment_count() { if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; comments_popup_link( sprintf( __( 'Leave a comment on %s', 'brizy-starter' ), get_the_title() ) ); echo ''; } } endif; if ( ! function_exists( 'brizy_starter_theme_register_sidebar' ) ) : function brizy_starter_theme_register_sidebar() { register_sidebars( 2, array( 'name' => 'Sidebar %d', 'id' => 'sidebar-%d', 'description' => 'Sidebar %d', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebars( 4, array( 'name' => 'Footer %d', 'id' => 'footer-%d', 'description' => 'Footer %d', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); } add_action( 'widgets_init', 'brizy_starter_theme_register_sidebar' ); endif; /** * * * * * * * * * * * * * * * * * * * Change this with your info * * * * * * * * * * * * * * * * * * * * * * * * * * */ /** * Register block styles. */ function brizy_starter_register_block_styles() { register_block_style( 'core/button', array( 'name' => 'fill-outline', 'label' => __( 'Fill Outline', 'brizy-starter' ), 'inline_style' => '.is-style-fill-outline .wp-block-button__link { border: 2px solid currentColor; padding: 0.5em 1.5em; }', ) ); } add_action( 'init', 'brizy_starter_register_block_styles' ); /** * Register block patterns. */ function brizy_starter_register_block_patterns() { register_block_pattern( 'brizy-starter/heading-with-paragraph', array( 'title' => __( 'Heading with paragraph', 'brizy-starter' ), 'description' => _x( 'A heading followed by a paragraph of text.', 'Block pattern description', 'brizy-starter' ), 'categories' => array( 'text' ), 'content' => '

' . esc_html__( 'Welcome to our site', 'brizy-starter' ) . '

' . esc_html__( 'This is a sample paragraph that you can customize to fit your needs.', 'brizy-starter' ) . '

', ) ); } add_action( 'init', 'brizy_starter_register_block_patterns' ); /** * Add editor style. */ function brizy_starter_add_editor_style() { add_editor_style( 'style.css' ); } add_action( 'after_setup_theme', 'brizy_starter_add_editor_style' ); /** * Set transient on theme activation to show plugin install notice */ function brizy_starter_theme_activation() { set_transient( 'brizy_starter_activation_notice', true, 5 * DAY_IN_SECONDS ); } add_action( 'after_switch_theme', 'brizy_starter_theme_activation' ); /** * Display admin notice to install Brizy plugin */ function brizy_starter_plugin_install_notice() { // Check if transient is set and user has permission if ( ! get_transient( 'brizy_starter_activation_notice' ) ) { return; } // Check if Brizy plugin is already installed or activated $plugin_path = 'brizy/brizy.php'; if ( is_plugin_active( $plugin_path ) ) { delete_transient( 'brizy_starter_activation_notice' ); return; } // Check if plugin is installed but not activated $installed_plugins = get_plugins(); $is_installed = isset( $installed_plugins[ $plugin_path ] ); // Build the plugin install/activate URL if ( $is_installed ) { $action_url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=' . $plugin_path ), 'activate-plugin_' . $plugin_path ); $button_text = __( 'Activate Brizy Plugin', 'brizy-starter' ); } else { $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=brizy' ), 'install-plugin_brizy' ); $button_text = __( 'Install Brizy Plugin', 'brizy-starter' ); } // Display the notice ?>