This repository has been archived by the owner on Feb 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds required functionality to support rendering FSE header and footer on all site pages (static and dynamic). It's also includes the data population functionality, which has now been removed from the plugin and will be delegated to each theme for maximum flexibility.
- Loading branch information
Showing
4 changed files
with
466 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
/** | ||
* The template for displaying the footer | ||
* | ||
* Contains the closing of the #content div and all content after. | ||
* | ||
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials | ||
* | ||
* @package WordPress | ||
* @subpackage Twenty_Nineteen | ||
* @since 1.0.0 | ||
*/ | ||
|
||
?> | ||
|
||
</div><!-- #content --> | ||
|
||
<?php | ||
// If FSE plugin is active, use Footer template part for content. | ||
if( defined( 'A8C_FSE_VERSION' ) ) { | ||
fse_get_header(); | ||
} | ||
|
||
// Otherwise we'll fall back to default Twenty Nineteen footer below. | ||
?> | ||
|
||
<?php if( ! defined( 'A8C_FSE_VERSION' ) ) : ?> | ||
<footer id="colophon" class="site-footer"> | ||
<?php get_template_part( 'template-parts/footer/footer', 'widgets' ); ?> | ||
<div class="site-info"> | ||
<?php $blog_info = get_bloginfo( 'name' ); ?> | ||
<?php if ( ! empty( $blog_info ) ) : ?> | ||
<a class="site-name" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>, | ||
<?php endif; ?> | ||
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentynineteen' ) ); ?>" class="imprint"> | ||
<?php | ||
/* translators: %s: WordPress. */ | ||
printf( __( 'Proudly powered by %s.', 'twentynineteen' ), 'WordPress' ); | ||
?> | ||
</a> | ||
<?php | ||
if ( function_exists( 'the_privacy_policy_link' ) ) { | ||
the_privacy_policy_link( '', '<span role="separator" aria-hidden="true"></span>' ); | ||
} | ||
?> | ||
<?php if ( has_nav_menu( 'footer' ) ) : ?> | ||
<nav class="footer-navigation" aria-label="<?php esc_attr_e( 'Footer Menu', 'twentynineteen' ); ?>"> | ||
<?php | ||
wp_nav_menu( | ||
array( | ||
'theme_location' => 'footer', | ||
'menu_class' => 'footer-menu', | ||
'depth' => 1, | ||
) | ||
); | ||
?> | ||
</nav><!-- .footer-navigation --> | ||
<?php endif; ?> | ||
</div><!-- .site-info --> | ||
</footer><!-- #colophon --> | ||
<?php endif; ?> | ||
|
||
</div><!-- #page --> | ||
|
||
<?php wp_footer(); ?> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
/** | ||
* The header for our theme | ||
* | ||
* This is the template that displays all of the <head> section and everything up until <div id="content"> | ||
* | ||
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials | ||
* | ||
* @package WordPress | ||
* @subpackage Twenty_Nineteen | ||
* @since 1.0.0 | ||
*/ | ||
?><!doctype html> | ||
<html <?php language_attributes(); ?>> | ||
<head> | ||
<meta charset="<?php bloginfo( 'charset' ); ?>" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="profile" href="https://gmpg.org/xfn/11" /> | ||
<?php wp_head(); ?> | ||
</head> | ||
|
||
<body <?php body_class(); ?>> | ||
<?php wp_body_open(); ?> | ||
<div id="page" class="site"> | ||
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentynineteen' ); ?></a> | ||
|
||
<?php | ||
// If FSE plugin is active, use Header template part for content. | ||
if( defined( 'A8C_FSE_VERSION' ) ) { | ||
fse_get_header(); | ||
} | ||
|
||
// Otherwise we'll fall back to default Twenty Nineteen header below. | ||
?> | ||
|
||
<?php if( ! defined( 'A8C_FSE_VERSION' ) ) : ?> | ||
|
||
<header id="masthead" class="<?php echo is_singular() && twentynineteen_can_show_post_thumbnail() ? 'site-header featured-image' : 'site-header'; ?>"> | ||
<div class="site-branding-container"> | ||
<?php get_template_part( 'template-parts/header/site', 'branding' ); ?> | ||
</div><!-- .site-branding-container --> | ||
|
||
<?php if ( is_singular() && twentynineteen_can_show_post_thumbnail() ) : ?> | ||
<div class="site-featured-image"> | ||
<?php | ||
twentynineteen_post_thumbnail(); | ||
the_post(); | ||
$discussion = ! is_page() && twentynineteen_can_show_post_thumbnail() ? twentynineteen_get_discussion_data() : null; | ||
|
||
$classes = 'entry-header'; | ||
if ( ! empty( $discussion ) && absint( $discussion->responses ) > 0 ) { | ||
$classes = 'entry-header has-discussion'; | ||
} | ||
?> | ||
<div class="<?php echo $classes; ?>"> | ||
<?php get_template_part( 'template-parts/header/entry', 'header' ); ?> | ||
</div><!-- .entry-header --> | ||
<?php rewind_posts(); ?> | ||
</div> | ||
<?php endif; ?> | ||
</header><!-- #masthead --> | ||
<?php endif; ?> | ||
|
||
<div id="content" class="site-content"> |
Oops, something went wrong.