update
This commit is contained in:
+97
-64
@@ -2,7 +2,8 @@
|
||||
/**
|
||||
* The template for displaying the footer
|
||||
*
|
||||
* Contains the closing of the #content div and all content after.
|
||||
* Three-column layout: site info | footer nav (menu-2) | social links (social).
|
||||
* Dynamic copyright year. All hardcoded external links removed.
|
||||
*
|
||||
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
|
||||
*
|
||||
@@ -10,75 +11,107 @@
|
||||
*/
|
||||
|
||||
?>
|
||||
</div><!-- #content .site-content .container -->
|
||||
|
||||
</div>
|
||||
</div><!-- #page .site -->
|
||||
|
||||
<footer id="colophon" class="site-footer footer">
|
||||
<div class="container">
|
||||
<div class="columns">
|
||||
|
||||
<footer class="footer">
|
||||
<div class="content has-text-centered">
|
||||
<p>
|
||||
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'cyywordpress' ) ); ?>">
|
||||
<?php
|
||||
/* translators: %s: CMS name, i.e. WordPress. */
|
||||
printf( esc_html__( '自豪地使用 %s', 'cyywordpress' ), 'WordPress' );
|
||||
?>
|
||||
</a>
|
||||
<!-- Column 1: Site info + footer widget 1 -->
|
||||
<div class="column is-4">
|
||||
<p class="footer-site-name">
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
|
||||
<?php bloginfo( 'name' ); ?>
|
||||
</a>
|
||||
</p>
|
||||
<?php
|
||||
$description = get_bloginfo( 'description' );
|
||||
if ( $description ) :
|
||||
echo '<p class="footer-site-description">' . esc_html( $description ) . '</p>';
|
||||
endif;
|
||||
?>
|
||||
<?php if ( is_active_sidebar( 'sidebar-footer-1' ) ) : ?>
|
||||
<div class="footer-widget-area">
|
||||
<?php dynamic_sidebar( 'sidebar-footer-1' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div><!-- .column -->
|
||||
|
||||
<span class="sep"> | </span>
|
||||
Theme: <a href="http://chuyaoyuan.com/">cyywordpress</a> by Chuyaoyuan(自用主题).
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
<!-- Column 2: Footer navigation (menu-2) + widget 2 -->
|
||||
<div class="column is-4">
|
||||
<?php if ( has_nav_menu( 'menu-2' ) ) : ?>
|
||||
<nav class="footer-nav" aria-label="<?php esc_attr_e( '页脚导航', 'cyywordpress' ); ?>">
|
||||
<?php
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => 'menu-2',
|
||||
'menu_id' => 'footer-menu',
|
||||
'depth' => 1,
|
||||
'container' => false,
|
||||
'menu_class' => 'footer-menu-list',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<?php if ( is_active_sidebar( 'sidebar-footer-2' ) ) : ?>
|
||||
<div class="footer-widget-area">
|
||||
<?php dynamic_sidebar( 'sidebar-footer-2' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div><!-- .column -->
|
||||
|
||||
</div><!-- #page -->
|
||||
<!-- Column 3: Social links (social menu) + widget 3 -->
|
||||
<div class="column is-4">
|
||||
<?php if ( has_nav_menu( 'social' ) ) : ?>
|
||||
<nav class="social-nav" aria-label="<?php esc_attr_e( '社交媒体链接', 'cyywordpress' ); ?>">
|
||||
<?php
|
||||
wp_nav_menu(
|
||||
array(
|
||||
'theme_location' => 'social',
|
||||
'menu_id' => 'social-menu',
|
||||
'depth' => 1,
|
||||
'container' => false,
|
||||
'menu_class' => 'social-menu-list',
|
||||
'link_before' => '<span class="screen-reader-text">',
|
||||
'link_after' => '</span>',
|
||||
)
|
||||
);
|
||||
?>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<?php if ( is_active_sidebar( 'sidebar-footer-3' ) ) : ?>
|
||||
<div class="footer-widget-area">
|
||||
<?php dynamic_sidebar( 'sidebar-footer-3' ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div><!-- .column -->
|
||||
|
||||
</div><!-- .columns -->
|
||||
</div><!-- .container -->
|
||||
|
||||
<div class="footer-bottom">
|
||||
<div class="container has-text-centered">
|
||||
<p class="footer-copyright">
|
||||
© <?php echo esc_html( (string) gmdate( 'Y' ) ); ?>
|
||||
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
|
||||
<?php bloginfo( 'name' ); ?>
|
||||
</a>.
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: WordPress link */
|
||||
esc_html__( '基于 %s 强力驱动', 'cyywordpress' ),
|
||||
'<a href="https://wordpress.org/" target="_blank" rel="noopener">WordPress</a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer><!-- #colophon -->
|
||||
|
||||
<?php wp_footer(); ?>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
// Get all "navbar-burger" elements
|
||||
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
|
||||
|
||||
// Check if there are any navbar burgers
|
||||
if ($navbarBurgers.length > 0) {
|
||||
|
||||
// Add a click event on each of them
|
||||
$navbarBurgers.forEach( el => {
|
||||
el.addEventListener('click', () => {
|
||||
|
||||
// Get the target from the "data-target" attribute
|
||||
const target = el.dataset.target;
|
||||
const $target = document.getElementById(target);
|
||||
|
||||
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
|
||||
el.classList.toggle('is-active');
|
||||
$target.classList.toggle('is-active');
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 当网页向下滑动 20px 出现"返回顶部" 按钮
|
||||
window.onscroll = function() {scrollFunction()};
|
||||
|
||||
function scrollFunction() {console.log(121);
|
||||
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
|
||||
document.getElementById("myBtn").style.display = "block";
|
||||
} else {
|
||||
document.getElementById("myBtn").style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
// 点击按钮,返回顶部
|
||||
function topFunction() {
|
||||
document.body.scrollTop = 0;
|
||||
document.documentElement.scrollTop = 0;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user