From 2515039d73615a7d373940013db8e6c496fc718d Mon Sep 17 00:00:00 2001 From: chuyaoyuan Date: Sun, 28 Feb 2021 23:44:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/CyyWordpress.iml | 28 + .idea/modules.xml | 8 + .idea/php.xml | 29 + .idea/vcs.xml | 6 + .idea/workspace.xml | 102 ++++ footer.php | 63 ++- functions.php | 36 +- header.php | 104 ++-- inc/bulmapress_navwalker.php | 61 +++ index.php | 78 ++- page.php | 20 + sidebar.php | 7 +- single.php | 26 +- style.css | 901 -------------------------------- template-parts/content-page.php | 87 +-- template-parts/content.php | 97 ++-- 16 files changed, 577 insertions(+), 1076 deletions(-) create mode 100644 .idea/CyyWordpress.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/php.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 inc/bulmapress_navwalker.php diff --git a/.idea/CyyWordpress.iml b/.idea/CyyWordpress.iml new file mode 100644 index 0000000..a2a1afb --- /dev/null +++ b/.idea/CyyWordpress.iml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ba5920a --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..fbf1471 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..b9bb1b5 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + $PROJECT_DIR$/composer.json + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1614349804640 + + + + + + + + + \ No newline at end of file diff --git a/footer.php b/footer.php index 4b12b38..43dc631 100644 --- a/footer.php +++ b/footer.php @@ -11,24 +11,57 @@ ?> - + + + + + + + + + + diff --git a/functions.php b/functions.php index 145984b..34506e9 100644 --- a/functions.php +++ b/functions.php @@ -122,17 +122,30 @@ add_action( 'after_setup_theme', 'cyywordpress_content_width', 0 ); * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function cyywordpress_widgets_init() { - register_sidebar( - array( - 'name' => esc_html__( 'Sidebar', 'cyywordpress' ), - 'id' => 'sidebar-1', - 'description' => esc_html__( 'Add widgets here.', 'cyywordpress' ), - 'before_widget' => '
', - 'after_widget' => '
', - 'before_title' => '

', - 'after_title' => '

', - ) - ); +// register_sidebar( +// array( +// 'name' => esc_html__( 'Sidebar', 'cyywordpress' ), +// 'id' => 'sidebar-1', +// 'description' => esc_html__( 'Add widgets here.', 'cyywordpress' ), +// 'before_widget' => '
', +// 'after_widget' => '
', +// 'before_title' => '

', +// 'after_title' => '

', +// ) +// ); + + register_sidebar( + array( + 'name' => esc_html__( 'Sidebar', 'cyywordpress' ), + 'id' => 'sidebar-1', + 'description' => esc_html__( 'Add widgets here.', 'cyywordpress' ), + + 'before_widget' => '
', + 'after_widget' => '
', + 'before_title' => '

', + 'after_title' => '

', + ) + ); } add_action( 'widgets_init', 'cyywordpress_widgets_init' ); @@ -178,3 +191,4 @@ if ( defined( 'JETPACK__VERSION' ) ) { require get_template_directory() . '/inc/jetpack.php'; } +require get_template_directory() . '/inc/bulmapress_navwalker.php'; diff --git a/header.php b/header.php index 71dfc16..dd57525 100644 --- a/header.php +++ b/header.php @@ -16,44 +16,82 @@ + + - + >
- + - + +
diff --git a/inc/bulmapress_navwalker.php b/inc/bulmapress_navwalker.php new file mode 100644 index 0000000..eb3bd64 --- /dev/null +++ b/inc/bulmapress_navwalker.php @@ -0,0 +1,61 @@ +"; + } + + public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { + + $liClasses = 'navbar-item '.$item->title; + + $hasChildren = $args->walker->has_children; + $liClasses .= $hasChildren? " has-dropdown is-hoverable": ""; + + if($hasChildren){ + $output .= ""; + } + $output .= ""; + } + + public function end_lvl (&$output, $depth = 0, $args = array()) { + + $output .= "
"; + } +} +?> \ No newline at end of file diff --git a/index.php b/index.php index ad33990..82648ac 100644 --- a/index.php +++ b/index.php @@ -14,43 +14,69 @@ get_header(); ?> +
+
+ +

+ +

+
+
-
- + + - if ( is_home() && ! is_front_page() ) : - ?> -
-

-
- + 欢迎来到这! Hello everyone. +
- /* Start the Loop */ - while ( have_posts() ) : - the_post(); - /* - * Include the Post-Type-specific template for the content. - * If you want to override this in a child theme, then include a file - * called content-___.php (where ___ is the Post Type name) and that will be used instead. - */ - get_template_part( 'template-parts/content', get_post_type() ); + +

article + - get_template_part( 'template-parts/content', 'none' ); - endif; - ?> - +
diff --git a/sidebar.php b/sidebar.php index 02c9263..c477f17 100644 --- a/sidebar.php +++ b/sidebar.php @@ -12,6 +12,7 @@ if ( ! is_active_sidebar( 'sidebar-1' ) ) { } ?> - +
+ + +
diff --git a/single.php b/single.php index 1ea2e08..d9f0264 100644 --- a/single.php +++ b/single.php @@ -10,6 +10,31 @@ get_header(); ?> + + +
+ 欢迎来到这! Hello everyone. +
+
- ul, -li > ol { - margin-bottom: 0; - margin-left: 1.5em; -} - -dt { - font-weight: 700; -} - -dd { - margin: 0 1.5em 1.5em; -} - -/* Make sure embeds and iframes fit their containers. */ -embed, -iframe, -object { - max-width: 100%; -} - -img { - height: auto; - max-width: 100%; -} - -figure { - margin: 1em 0; -} - -table { - margin: 0 0 1.5em; - width: 100%; -} - -/* Links ---------------------------------------------- */ -a { - color: #4169e1; -} - -a:visited { - color: #800080; -} - -a:hover, -a:focus, -a:active { - color: #191970; -} - -a:focus { - outline: thin dotted; -} - -a:hover, -a:active { - outline: 0; -} - -/* Forms ---------------------------------------------- */ -button, -input[type="button"], -input[type="reset"], -input[type="submit"] { - border: 1px solid; - border-color: #ccc #ccc #bbb; - border-radius: 3px; - background: #e6e6e6; - color: rgba(0, 0, 0, 0.8); - line-height: 1; - padding: 0.6em 1em 0.4em; -} - -button:hover, -input[type="button"]:hover, -input[type="reset"]:hover, -input[type="submit"]:hover { - border-color: #ccc #bbb #aaa; -} - -button:active, -button:focus, -input[type="button"]:active, -input[type="button"]:focus, -input[type="reset"]:active, -input[type="reset"]:focus, -input[type="submit"]:active, -input[type="submit"]:focus { - border-color: #aaa #bbb #bbb; -} - -input[type="text"], -input[type="email"], -input[type="url"], -input[type="password"], -input[type="search"], -input[type="number"], -input[type="tel"], -input[type="range"], -input[type="date"], -input[type="month"], -input[type="week"], -input[type="time"], -input[type="datetime"], -input[type="datetime-local"], -input[type="color"], -textarea { - color: #666; - border: 1px solid #ccc; - border-radius: 3px; - padding: 3px; -} - -input[type="text"]:focus, -input[type="email"]:focus, -input[type="url"]:focus, -input[type="password"]:focus, -input[type="search"]:focus, -input[type="number"]:focus, -input[type="tel"]:focus, -input[type="range"]:focus, -input[type="date"]:focus, -input[type="month"]:focus, -input[type="week"]:focus, -input[type="time"]:focus, -input[type="datetime"]:focus, -input[type="datetime-local"]:focus, -input[type="color"]:focus, -textarea:focus { - color: #111; -} - -select { - border: 1px solid #ccc; -} - -textarea { - width: 100%; -} - -/*-------------------------------------------------------------- -# Layouts ---------------------------------------------------------------*/ - -/*-------------------------------------------------------------- -# Components ---------------------------------------------------------------*/ - -/* Navigation ---------------------------------------------- */ -.main-navigation { - display: block; - width: 100%; -} - -.main-navigation ul { - display: none; - list-style: none; - margin: 0; - padding-left: 0; -} - -.main-navigation ul ul { - box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2); - float: left; - position: absolute; - top: 100%; - left: -999em; - z-index: 99999; -} - -.main-navigation ul ul ul { - left: -999em; - top: 0; -} - -.main-navigation ul ul li:hover > ul, -.main-navigation ul ul li.focus > ul { - display: block; - left: auto; -} - -.main-navigation ul ul a { - width: 200px; -} - -.main-navigation ul li:hover > ul, -.main-navigation ul li.focus > ul { - left: auto; -} - -.main-navigation li { - position: relative; -} - -.main-navigation a { - display: block; - text-decoration: none; -} - -/* Small menu. */ -.menu-toggle, -.main-navigation.toggled ul { - display: block; -} - -@media screen and (min-width: 37.5em) { - - .menu-toggle { - display: none; - } - - .main-navigation ul { - display: flex; - } -} - -.site-main .comment-navigation, -.site-main -.posts-navigation, -.site-main -.post-navigation { - margin: 0 0 1.5em; -} - -.comment-navigation .nav-links, -.posts-navigation .nav-links, -.post-navigation .nav-links { - display: flex; -} - -.comment-navigation .nav-previous, -.posts-navigation .nav-previous, -.post-navigation .nav-previous { - flex: 1 0 50%; -} - -.comment-navigation .nav-next, -.posts-navigation .nav-next, -.post-navigation .nav-next { - text-align: end; - flex: 1 0 50%; -} - -/* Posts and pages ---------------------------------------------- */ -.sticky { - display: block; -} - -.post, -.page { - margin: 0 0 1.5em; -} - -.updated:not(.published) { - display: none; -} - -.page-content, -.entry-content, -.entry-summary { - margin: 1.5em 0 0; -} - -.page-links { - clear: both; - margin: 0 0 1.5em; -} - -/* Comments ---------------------------------------------- */ -.comment-content a { - word-wrap: break-word; -} - -.bypostauthor { - display: block; -} - -/* Widgets ---------------------------------------------- */ -.widget { - margin: 0 0 1.5em; -} - -.widget select { - max-width: 100%; -} - -/* Media ---------------------------------------------- */ -.page-content .wp-smiley, -.entry-content .wp-smiley, -.comment-content .wp-smiley { - border: none; - margin-bottom: 0; - margin-top: 0; - padding: 0; -} - -/* Make sure logo link wraps around logo image. */ -.custom-logo-link { - display: inline-block; -} - -/* Captions ---------------------------------------------- */ -.wp-caption { - margin-bottom: 1.5em; - max-width: 100%; -} - -.wp-caption img[class*="wp-image-"] { - display: block; - margin-left: auto; - margin-right: auto; -} - -.wp-caption .wp-caption-text { - margin: 0.8075em 0; -} - -.wp-caption-text { - text-align: center; -} - -/* Galleries ---------------------------------------------- */ -.gallery { - margin-bottom: 1.5em; - display: grid; - grid-gap: 1.5em; -} - -.gallery-item { - display: inline-block; - text-align: center; - width: 100%; -} - -.gallery-columns-2 { - grid-template-columns: repeat(2, 1fr); -} - -.gallery-columns-3 { - grid-template-columns: repeat(3, 1fr); -} - -.gallery-columns-4 { - grid-template-columns: repeat(4, 1fr); -} - -.gallery-columns-5 { - grid-template-columns: repeat(5, 1fr); -} - -.gallery-columns-6 { - grid-template-columns: repeat(6, 1fr); -} - -.gallery-columns-7 { - grid-template-columns: repeat(7, 1fr); -} - -.gallery-columns-8 { - grid-template-columns: repeat(8, 1fr); -} - -.gallery-columns-9 { - grid-template-columns: repeat(9, 1fr); -} - -.gallery-caption { - display: block; -} - -/*-------------------------------------------------------------- -# Plugins ---------------------------------------------------------------*/ - -/* Jetpack infinite scroll ---------------------------------------------- */ - -/* Hide the Posts Navigation and the Footer when Infinite Scroll is in use. */ -.infinite-scroll .posts-navigation, -.infinite-scroll.neverending .site-footer { - display: none; -} - -/* Re-display the Theme Footer when Infinite Scroll has reached its end. */ -.infinity-end.neverending .site-footer { - display: block; -} - -/*-------------------------------------------------------------- -# Utilities ---------------------------------------------------------------*/ - -/* Accessibility ---------------------------------------------- */ - -/* Text meant only for screen readers. */ -.screen-reader-text { - border: 0; - clip: rect(1px, 1px, 1px, 1px); - clip-path: inset(50%); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute !important; - width: 1px; - word-wrap: normal !important; -} - -.screen-reader-text:focus { - background-color: #f1f1f1; - border-radius: 3px; - box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); - clip: auto !important; - clip-path: none; - color: #21759b; - display: block; - font-size: 0.875rem; - font-weight: 700; - height: auto; - left: 5px; - line-height: normal; - padding: 15px 23px 14px; - text-decoration: none; - top: 5px; - width: auto; - z-index: 100000; -} - -/* Do not show the outline on the skip link target. */ -#primary[tabindex="-1"]:focus { - outline: 0; -} - -/* Alignments ---------------------------------------------- */ -.alignleft { - - /*rtl:ignore*/ - float: left; - - /*rtl:ignore*/ - margin-right: 1.5em; - margin-bottom: 1.5em; -} - -.alignright { - - /*rtl:ignore*/ - float: right; - - /*rtl:ignore*/ - margin-left: 1.5em; - margin-bottom: 1.5em; -} - -.aligncenter { - clear: both; - display: block; - margin-left: auto; - margin-right: auto; - margin-bottom: 1.5em; -} diff --git a/template-parts/content-page.php b/template-parts/content-page.php index 5bdfd2a..3ace5d1 100644 --- a/template-parts/content-page.php +++ b/template-parts/content-page.php @@ -9,46 +9,55 @@ ?> -
> -
- ', '' ); ?> -
- -
- '', - ) - ); - ?> -
+
+
+
+
- -
- %s', 'cyywordpress' ), - array( - 'span' => array( - 'class' => array(), - ), - ) - ), - wp_kses_post( get_the_title() ) - ), - '', - '' - ); - ?> -
- -
+ ', '

' ); ?> + + + + + +
+ '', + ) + ); + ?> + + +
+ %s', 'cyywordpress' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + wp_kses_post( get_the_title() ) + ), + '', + '' + ); + ?> +
+ + +
+ + diff --git a/template-parts/content.php b/template-parts/content.php index 1d99d3d..c3ebd99 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -9,55 +9,58 @@ ?> -
> -
- ', '' ); - else : - the_title( '

', '

' ); - endif; +
+
+
+
- if ( 'post' === get_post_type() ) : - ?> - - -
+ ', '

' ); + else : + the_title( '

', '

' ); + endif; - + if ( 'post' === get_post_type() ) : + ?> +

+ +

+ + + -
- "%s"', 'cyywordpress' ), - array( - 'span' => array( - 'class' => array(), - ), - ) - ), - wp_kses_post( get_the_title() ) - ) - ); +
+ "%s"', 'cyywordpress' ), + array( + 'span' => array( + 'class' => array(), + ), + ) + ), + wp_kses_post( get_the_title() ) + ) + ); - wp_link_pages( - array( - 'before' => '', - ) - ); - ?> -
+ wp_link_pages( + array( + 'before' => '', + ) + ); + ?> -
- -
-
+
+ +
+ + + \ No newline at end of file