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 e773eed commit 8f008ff
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 312 deletions.
9 changes: 4 additions & 5 deletions 404.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
<?php get_template_part('components/app-head'); ?>
<body <?php body_class(); ?>>
<?php get_template_part('components/app-header'); ?>
<main class="main">
<div class="section">
<div class="inner is-width-min">
<p class="text">404</p>
</div>
<?php get_template_part('components/app-menu'); ?>
<main class="app-main">
<div class="app-main-contents">
<p>404</p>
</div>
</main>
<?php get_template_part('components/app-footer'); ?>
Expand Down
24 changes: 12 additions & 12 deletions components/app-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
// 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>
<?php if( has_nav_menu('menu_header_main') ) : ?>
<section class="app-menu">
<nav class="app-menu-nav">
<?php wp_nav_menu(array(
'container' => false,
'theme_location' => 'menu_header_main',
'items_wrap' => '<ul>%3$s</ul>',
'depth' => 1,
)); ?>
</nav>
</section>
<?php endif; ?>
2 changes: 1 addition & 1 deletion components/app-title.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// App Title
//----------------------------------------------------
?>
<h1>
<h1 class="app-title">
<?php if (is_home() || is_front_page()): ?>
Home
<?php elseif (is_search()): ?>
Expand Down
32 changes: 17 additions & 15 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@
<?php get_template_part('components/app-header'); ?>
<?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; ?>
<div class="app-main-contents">
<?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; ?>
</div>
</main>
<?php get_template_part('components/app-footer'); ?>
</body>
Expand Down
22 changes: 15 additions & 7 deletions page.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@
<?php get_template_part('components/app-header'); ?>
<?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; ?>
<div class="app-main-contents">
<?php if (have_posts()): ?>
<article class="article">
<?php while (have_posts()): the_post(); ?>
<header class="article-header">
<?php get_template_part('components/app-title'); ?>
</header>
<div class="article-contents">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php wp_link_pages(); ?>
</article>
<?php endif; ?>
</div>
</main>
<?php get_template_part('components/app-footer'); ?>
</body>
Expand Down
26 changes: 18 additions & 8 deletions single.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@
<?php get_template_part('components/app-header'); ?>
<?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; ?>
<div class="app-main-contents">
<?php if (have_posts()): ?>
<article class="article">
<?php while (have_posts()): the_post(); ?>
<header class="article-header">
<?php get_template_part('components/app-title'); ?>
<p class="article-date">
<time><?php the_time('Y年n月j日'); ?></time>
</p>
</header>
<div class="article-contents">
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php wp_link_pages(); ?>
</article>
<?php endif; ?>
</div>
</main>
<?php get_template_part('components/app-footer'); ?>
</body>
Expand Down
Loading

0 comments on commit 8f008ff

Please sign in to comment.