160, 'width' => 200, 'flex-height' => false, 'flex-width' => false, 'header-text' => array( 'site-title', 'site-description' ), 'unlink-homepage-logo' => false )); add_editor_style( array( lc_flock_get_theme_fonts_url(), 'css/gutenberg-style.css' ) ); register_nav_menus( array( 'primary' => __( 'Primary menu', 'flock' ), 'footer' => __( 'Secondary menu', 'flock' ), ) ); } } add_action( 'after_setup_theme', 'lc_flock_setup_theme' ); /** * @since 1.0 */ function lc_flock_widgets_init() { $name = __( 'Footer Widget Area %d', 'flock' ); $description = __( 'Widgets in this area will be displayed in the footer.', 'flock' ); for ( $i = 1; $i < 4; $i++ ) { register_sidebar( array( 'name' => sprintf( $name, $i ), 'id' => "footer_widgets_{$i}", 'description' => $description, 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } } add_action( 'widgets_init', 'lc_flock_widgets_init' ); /** * @since 1.0 */ function lc_flock_enqueue_styles_scripts() { $theme_url = get_template_directory_uri(); wp_enqueue_style( 'lc-flock-google-fonts', lc_flock_get_theme_fonts_url(), array(), null ); wp_enqueue_style( 'lc-flock-style', get_stylesheet_uri() ); // Enqueues global script in the footer. wp_enqueue_script( 'lc-flock-global', "{$theme_url}/js/global.js", array(), wp_get_theme()->get( 'Version' ), true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'lc_flock_enqueue_styles_scripts' ); /** * @since 1.0 */ function lc_flock_archive_title( $title ) { if ( is_author() ) { $title = sprintf( esc_html__( 'All posts by %s', 'flock' ), '' . get_the_author() . '' ); } return $title; } add_filter( 'get_the_archive_title', 'lc_flock_archive_title' ); // ----- Ultility Functions ----- if (! function_exists( 'lc_flock_get_theme_fonts_url' ) ) { /** * Returns the URL of the Google Fonts used by the theme. * * @since 1.0 * @return string */ function lc_flock_get_theme_fonts_url() { return 'https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,600i,700%7CUbuntu:400,500,700%7CUbuntu+Mono:400,700display=swap'; } } // ----- Callback Functions ----- if (! function_exists( 'lc_flock_render_comment' ) ) { /** * Displays a comment. * Callback of wp_list_comments() called in comments.php * * @since 1.0 * @param object $comment * @param array $args * @param int $depth */ function lc_flock_render_comment( $comment, $args, $depth ) { $avatar_size = 50; $comment_id = (int) get_comment_ID(); $comment_author = esc_html( get_comment_author( $comment ) ); $comment_author_url = esc_url( get_comment_author_url( $comment ) ); $avatar_alt_text = sprintf( esc_attr__( "%s's avatar.", 'flock' ), $comment_author ); $edit_link_url = get_edit_comment_link( $comment ); $edit_link = ''; if ( $edit_link_url ) { $edit_link = ' — ' . esc_html__( 'Edit Comment', 'flock' ) . ''; } echo '
  • #', $comment_id, '', get_avatar( $comment, $avatar_size, '', $avatar_alt_text ); if ( $comment_author_url && ( $comment_author_url != home_url() ) ) { echo '', $comment_author, ''; } else { echo '', $comment_author, ''; } if ( '0' == $comment->comment_approved ) { echo '

    ', esc_html__( 'Your comment is awaiting moderation.', 'flock' ), '', $edit_link, '

    '; } else { echo '
    ', $edit_link, '
    '; } echo '
    '; comment_text(); echo '
    '; $args['depth'] = $depth; $args['reply_text'] = esc_html__( 'Reply ↓', 'flock' ); $reply_link = get_comment_reply_link( $args, $comment, null ); if ( $reply_link ) { echo '
    ', $reply_link, '
    '; } echo '
    '; } } if (! function_exists( 'lc_flock_render_comment_end' ) ) { /** * Displays the closing markup of a comment. * Callback of wp_list_comments() called in comments.php * * @since 1.0 */ function lc_flock_render_comment_end() { echo "
  • \n"; } } ?>