Skip to content

Commit

Permalink
Rewrite style #19
Browse files Browse the repository at this point in the history
  • Loading branch information
qrac committed Jul 7, 2020
1 parent 9663e6f commit e773eed
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 140 deletions.
21 changes: 7 additions & 14 deletions components/app-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@
// App Header
//----------------------------------------------------
?>
<header>
<h1><?php bloginfo('name'); ?></h1>
<nav>
<a href="<?php echo esc_url(home_url('/')); ?>">Home</a>
<?php if( has_nav_menu('menu_header_main') ) : ?>
<?php wp_nav_menu(array(
'container' => false,
'theme_location' => 'menu_header_main',
'items_wrap' => '%3$s',
'depth' => 1,
'walker' => new custom_walker_nav_menu
)); ?>
<?php endif; ?>
</nav>
<header class="app-header">
<div class="app-header-contents">
<a class="app-header-site-name" href="<?php echo esc_url(home_url('/')); ?>">
<?php bloginfo('name'); ?>
</a>
<h2 class="app-header-description"><?php bloginfo('description'); ?></h2>
</div>
</header>
17 changes: 17 additions & 0 deletions components/app-menu.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
//----------------------------------------------------
// App Menu
//----------------------------------------------------
?>
<section class="app-menu">
<nav class="app-menu-nav">
<?php if( has_nav_menu('menu_header_main') ) : ?>
<?php wp_nav_menu(array(
'container' => false,
'theme_location' => 'menu_header_main',
'items_wrap' => '<ul>%3$s</ul>',
'depth' => 1,
)); ?>
<?php endif; ?>
</nav>
</section>
33 changes: 18 additions & 15 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@
<?php get_template_part('components/app-head'); ?>
<body <?php body_class(); ?>>
<?php get_template_part('components/app-header'); ?>
<?php get_template_part('components/app-title'); ?>
<?php if (have_posts()): ?>
<ul>
<?php while (have_posts()): the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?php if (function_exists("pagination")): ?>
<?php pagination($additional_loop->max_num_pages);?>
<?php endif; ?>
<?php get_template_part('components/app-menu'); ?>
<main class="app-main">
<?php get_template_part('components/app-title'); ?>
<?php if (have_posts()): ?>
<ul>
<?php while (have_posts()): the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?php if (function_exists("pagination")): ?>
<?php pagination($additional_loop->max_num_pages);?>
<?php endif; ?>
</main>
<?php get_template_part('components/app-footer'); ?>
</body>
</html>
17 changes: 10 additions & 7 deletions page.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
<?php get_template_part('components/app-head'); ?>
<body <?php body_class(); ?>>
<?php get_template_part('components/app-header'); ?>
<?php get_template_part('components/app-title'); ?>
<?php if (have_posts()): ?>
<?php while (have_posts()): the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php wp_link_pages(); ?>
<?php endif; ?>
<?php get_template_part('components/app-menu'); ?>
<main class="app-main">
<?php get_template_part('components/app-title'); ?>
<?php if (have_posts()): ?>
<?php while (have_posts()): the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php wp_link_pages(); ?>
<?php endif; ?>
</main>
<?php get_template_part('components/app-footer'); ?>
</body>
</html>
19 changes: 11 additions & 8 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
<?php get_template_part('components/app-head'); ?>
<body <?php body_class(); ?>>
<?php get_template_part('components/app-header'); ?>
<?php get_template_part('components/app-title'); ?>
<?php if (have_posts()): ?>
<?php while (have_posts()): the_post(); ?>
<p><time><?php the_time('Y年n月j日'); ?></time></p>
<?php the_content(); ?>
<?php endwhile; ?>
<?php wp_link_pages(); ?>
<?php endif; ?>
<?php get_template_part('components/app-menu'); ?>
<main class="app-main">
<?php get_template_part('components/app-title'); ?>
<?php if (have_posts()): ?>
<?php while (have_posts()): the_post(); ?>
<p><time><?php the_time('Y年n月j日'); ?></time></p>
<?php the_content(); ?>
<?php endwhile; ?>
<?php wp_link_pages(); ?>
<?php endif; ?>
</main>
<?php get_template_part('components/app-footer'); ?>
</body>
</html>
Loading

0 comments on commit e773eed

Please sign in to comment.