code organization

This commit is contained in:
Fabiano Alencar 2018-03-08 15:45:50 -03:00
parent f159036214
commit cea714e42f
13 changed files with 90 additions and 124 deletions

View File

@ -12,8 +12,6 @@ if (
}
?>
<?php get_header(); ?>
<div class="container-fluid mt-5">
<div class="row">
<div class="col-sm">
@ -36,9 +34,6 @@ if (
<?php get_sidebar(); ?>
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</div> <!-- /.row -->
<?php get_footer(); ?>

View File

@ -1,6 +1,4 @@
<?php get_header(); ?>
<div class="container-fluid mt-5">
<div class="row">
<div class="col-sm">
@ -17,6 +15,4 @@
<?php get_sidebar(); ?>
</div><!-- /.row -->
</div><!-- /.container-fluid -->
<?php get_footer(); ?>

View File

@ -1,4 +1,4 @@
</div>
<footer class="container-fluid p-4 p-sm-5 mt-2 bg-haiti">
<div class="row">
<div class="col-12 col-lg">

View File

@ -17,4 +17,6 @@
<div class="page-header header-filter clear-filter" style="background-image: url('<?php echo get_template_directory_uri() ?>/assets/images/capa.png')">
<!-- <img src="<?php echo get_template_directory_uri() ?>/assets/images/capa.png" class="img-fluid header-img">
<i class="material-icons float-right p-1 m-2 mt-3 text-white rounded-circle position-absolute header-icon">settings</i> -->
</div>
</div>
<div class="container-fluid mt-5">

View File

@ -1,11 +1,7 @@
<?php get_header(); ?>
<div class="container-fluid">
<div class="col-sm">
<div id="content" role="main">
<?php get_template_part('template-parts/index-loop'); ?>
<?php get_template_part('template-parts/loop'); ?>
</div><!-- /#content -->
</div>
</div>
<?php get_footer();

View File

@ -1,17 +1,13 @@
<?php get_header(); ?>
<div class="row">
<div class="container-fluid mt-5">
<div class="row">
<div class="col-sm">
<div id="content" role="main">
<?php get_template_part('template-parts/page-content'); ?>
</div><!-- /#content -->
</div>
<div class="col-sm">
<div id="content" role="main">
<?php get_template_part('template-parts/page-content'); ?>
</div><!-- /#content -->
</div>
<?php get_sidebar(); ?>
</div><!-- /.row -->
</div><!-- /.container-fluid -->
<?php get_sidebar(); ?>
</div><!-- /.row -->
<?php get_footer(); ?>

View File

@ -1,20 +1,12 @@
<?php get_header(); ?>
<div class="container-fluid mt-5">
<div class="row">
<div class="col-sm">
<div id="content" role="main">
<header class="mb-4 border-bottom">
<h1><?php _e('Search Results for', 'tainacan-theme'); ?> &ldquo;<?php the_search_query(); ?>&rdquo;</h1>
</header>
<?php get_template_part('template-parts/search-results'); ?>
<?php get_template_part('template-parts/loop'); ?>
</div><!-- /#content -->
</div>
<?php get_sidebar(); ?>
</div><!-- /.row -->
</div><!-- /.container-fluid -->
<?php get_footer(); ?>

View File

@ -1,15 +1,18 @@
<?php get_header(); ?>
<div class="container-fluid mt-5">
<div class="row">
<div class="col col-sm-9 mx-sm-auto p-3">
<div id="content" role="main">
<?php get_template_part('template-parts/single-post', get_post_format()); ?>
<?php if(have_posts()):
while(have_posts()): the_post(); ?>
<?php get_template_part('template-parts/single-post', get_post_format());
endwhile;
else:
wp_redirect(esc_url( home_url() ) . '/404', 404);
exit;
endif; ?>
</div><!-- /#content -->
</div>
</div><!-- /.row -->
</div><!-- /.container-fluid -->
<?php get_footer(); ?>

View File

@ -1,21 +0,0 @@
<div class="<?php if(!is_single()) : echo 'card-columns'; endif; ?> mt-3">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="col-sm">
<div class="card w-100">
<h5 class="card-header"><?php the_title(); ?></h5>
<div class="card-body">
<p class="card-text"><?php if(is_single()) : the_content(); else : the_excerpt(); endif; ?></p>
<a href="<?php the_permalink(); ?>" class="btn btn-primary">View more</a>
</div>
</div>
</div>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.', 'tainacan-theme'); ?></p>
<?php endif; ?>
</div>
<nav class="mx-auto">
<?php echo pagination_bst4(); ?>
</nav>

View File

@ -0,0 +1,7 @@
<div class="card w-100">
<h5 class="card-header"><?php the_title(); ?></h5>
<div class="card-body">
<p class="card-text"><?php if(is_single()) : the_content(); else : the_excerpt(); endif; ?></p>
<a href="<?php the_permalink(); ?>" class="btn btn-primary">View more</a>
</div>
</div>

View File

@ -0,0 +1,20 @@
<?php if(have_posts()): ?>
<div class="card-columns mt-3">
<div class="col-sm">
<?php while(have_posts()):
the_post();
//Index
if(!is_single())
get_template_part('template-parts/list-post');
else
printf('<p>%2</p>', _e('Sorry, no posts matched your criteria.', 'tainacan-theme'));
endwhile; ?>
</div>
</div>
<nav class="mx-auto">
<?php echo pagination_bst4(); ?>
</nav>
<?php else:
wp_redirect(esc_url( home_url() ) . '/404', 404);
exit; ?>
<?php endif; ?>

View File

@ -1,12 +0,0 @@
<?php if(have_posts()): while(have_posts()): the_post(); ?>
<article role="article" id="post_<?php the_ID()?>" <?php post_class()?>>
<header>
<h2><a href="<?php the_permalink(); ?>"><?php the_title()?></a></h2>
</header>
<?php the_excerpt(); ?>
</article>
<?php endwhile; else: ?>
<div class="alert alert-warning">
<i class="material-icons">warning</i> <?php _e('Sorry, your search yielded no results.', 'tainacan-theme'); ?>
</div>
<?php endif; ?>

View File

@ -1,49 +1,41 @@
<?php if(have_posts()):
while(have_posts()): the_post(); ?>
<article role="article" id="post_<?php the_ID()?>" <?php post_class()?>>
<header class="mb-4">
<h1>
<?php the_title()?>
</h1>
<div class="header-meta text-muted">
<?php
_e('By', 'tainacan-theme');
echo ' ';
the_author_posts_link();
echo ' ';
_e('on', 'tainacan-theme');
echo ' ';
tainacan_post_date();
?>
</div>
</header>
<main>
<?php
the_post_thumbnail();
the_content();
wp_link_pages();
?>
</main>
<footer class="mt-5 border-top pt-3">
<p>
<?php
_e('Category: ', 'tainacan-theme');
the_category(', ') ?> |
<?php if (has_tag()) {
the_tags('Tags: ', ', '); ?> |
<?php }
_e('Comments', 'tainacan-theme'); echo ':'; ?>
<?php comments_popup_link(__('None', 'tainacan-theme'), '1', '%'); ?>
</p>
</footer>
</article>
<article role="article" id="post_<?php the_ID()?>" <?php post_class()?>>
<header class="mb-4">
<h1>
<?php the_title()?>
</h1>
<div class="header-meta text-muted">
<?php
_e('By', 'tainacan-theme');
echo ' ';
the_author_posts_link();
echo ' ';
_e('on', 'tainacan-theme');
echo ' ';
tainacan_post_date();
?>
</div>
</header>
<main>
<?php
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile;
else:
wp_redirect(esc_url( home_url() ) . '/404', 404);
exit;
endif;
?>
the_post_thumbnail();
the_content();
wp_link_pages();
?>
</main>
<footer class="mt-5 border-top pt-3">
<p>
<?php
_e('Category: ', 'tainacan-theme');
the_category(', ') ?> |
<?php if (has_tag()) {
the_tags('Tags: ', ', '); ?> |
<?php }
_e('Comments', 'tainacan-theme'); echo ':'; ?>
<?php comments_popup_link(__('None', 'tainacan-theme'), '1', '%'); ?>
</p>
</footer>
</article>
<?php
if ( comments_open() || get_comments_number() ) :
comments_template();
endif; ?>