change default collections list viewmode

This commit is contained in:
Leo Germani 2018-07-19 13:30:29 -03:00
parent 006e20bfe1
commit f2f632ff20
4 changed files with 70 additions and 70 deletions

View File

@ -33,9 +33,9 @@
<span class="d-none d-md-inline"><?php _e('View Mode', 'tainacan-theme'); ?></span>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuViewMode">
<a class="dropdown-item <?php tainacan_active(get_query_var('tainacan_collections_viewmode'), 'table'); ?>" href="<?php echo add_query_arg('tainacan_collections_viewmode', 'table'); ?>"><?php _e('Table', 'tainacan-theme'); ?></a>
<a class="dropdown-item <?php tainacan_active(get_query_var('tainacan_collections_viewmode'), 'cards'); ?>" href="<?php echo add_query_arg('tainacan_collections_viewmode', 'cards'); ?>"><?php _e('Cards', 'tainacan-theme'); ?></a>
<a class="dropdown-item <?php tainacan_active(get_query_var('tainacan_collections_viewmode'), 'grid'); ?>" href="<?php echo add_query_arg('tainacan_collections_viewmode', 'grid'); ?>"><?php _e('Grid', 'tainacan-theme'); ?></a>
<a class="dropdown-item <?php tainacan_active(get_query_var('tainacan_collections_viewmode'), 'grid'); ?>" href="<?php echo add_query_arg('tainacan_collections_viewmode', 'grid'); ?>"><?php _e('Thumbnails', 'tainacan-theme'); ?></a>
<a class="dropdown-item <?php tainacan_active(get_query_var('tainacan_collections_viewmode'), 'table'); ?>" href="<?php echo add_query_arg('tainacan_collections_viewmode', 'table'); ?>"><?php _e('Table', 'tainacan-theme'); ?></a>
</div>
</div>

View File

@ -1,40 +0,0 @@
<?php if(have_posts()): ?>
<div class="tainacan-list-post container">
<div class="row mx-auto">
<?php while(have_posts()): the_post(); ?>
<div class="col col-lg-4 tainacan-list-collection--card mt-5">
<a class="tainacan-list-collection--card-link mx-1" href="<?php the_permalink(); ?>">
<h5 class="tainacan-list-collection--title text-black"><?php the_title(); ?></h5>
<div class="media">
<?php if ( has_post_thumbnail() && get_the_post_thumbnail_url(get_the_ID()) ) : ?>
<img src="<?php echo get_the_post_thumbnail_url(get_the_ID(), 'collection-list-card') ?>" class="tainacan-list-collection--card-img rounded-0 align-self-center mr-3" alt="">
<?php else : ?>
<div class="image-placeholder">
<h4>
<?php
$get_title = get_the_title();
$ltr_group = substr($get_title, 0, 1);
echo $ltr_group;
?>
</h4>
</div>
<?php endif; ?>
<div class="media-body text-oslo-gray">
<p><?php echo get_the_excerpt(); ?></p>
<p>
<?php _e('Create by: ');?> <?php the_author(); ?><br>
<?php _e('Date: ');?> <?php tainacan_post_date(); ?>
</p>
</div>
</div>
</a>
</div>
<?php endwhile; ?>
</div>
</div>
<?php echo tainacan_pagination(3); ?>
<?php else: ?>
<?php _e('Nothing found', 'tainacan-theme'); ?>
<?php endif; ?>

View File

@ -0,0 +1,48 @@
<?php if(have_posts()): ?>
<div class="mt-5 tainacan-list-post table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th scope="col"><?php //_e('Miniature'); ?></th>
<th scope="col"><?php _e('Title'); ?></th>
<th scope="col"><?php _e('Description'); ?></th>
<!-- <th scope="col"><?php //_e('Date'); ?></th>
<th scope="col"><?php //_e('Author'); ?></th> -->
</tr>
</thead>
<tbody>
<?php while(have_posts()): the_post(); ?>
<tr class="tainacan-list-collection" onclick="location.href='<?php the_permalink(); ?>'">
<td class="collection-miniature">
<?php if ( has_post_thumbnail() && get_the_post_thumbnail_url(get_the_ID()) ) : ?>
<img src="<?php echo get_the_post_thumbnail_url(get_the_ID(), 'tainacan-small') ?>" class="img-fluid rounded-circle" alt="">
<?php else : ?>
<div class="image-placeholder">
<h4>
<?php
$get_title = get_the_title();
$ltr_group = substr($get_title, 0, 1);
echo $ltr_group;
?>
</h4>
</div>
<?php endif; ?>
</td>
<td class="collection-title text-black"><?php the_title(); ?></td>
<td class="collection-description text-oslo-gray"><?php the_excerpt(); ?></td>
<!-- <td class="collection-date text-oslo-gray"><?php //echo get_the_date(); ?></td>
<td class="collection-create-by text-oslo-gray"><?php //_e('Created by', 'tainacan-theme'); ?> <?php the_author_posts_link(); ?></td> -->
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
<?php echo tainacan_pagination(3); ?>
<?php else: ?>
<?php _e('Nothing found', 'tainacan-theme'); ?>
<?php endif; ?>

View File

@ -1,22 +1,13 @@
<?php if(have_posts()): ?>
<div class="mt-5 tainacan-list-post table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th scope="col"><?php //_e('Miniature'); ?></th>
<th scope="col"><?php _e('Title'); ?></th>
<th scope="col"><?php _e('Description'); ?></th>
<!-- <th scope="col"><?php //_e('Date'); ?></th>
<th scope="col"><?php //_e('Author'); ?></th> -->
</tr>
</thead>
<tbody>
<?php while(have_posts()): the_post(); ?>
<tr class="tainacan-list-collection" onclick="location.href='<?php the_permalink(); ?>'">
<td class="collection-miniature">
<div class="tainacan-list-post container">
<div class="row mx-auto">
<?php while(have_posts()): the_post(); ?>
<div class="col col-lg-4 tainacan-list-collection--card mt-5">
<a class="tainacan-list-collection--card-link mx-1" href="<?php the_permalink(); ?>">
<h5 class="tainacan-list-collection--title text-black"><?php the_title(); ?></h5>
<div class="media">
<?php if ( has_post_thumbnail() && get_the_post_thumbnail_url(get_the_ID()) ) : ?>
<img src="<?php echo get_the_post_thumbnail_url(get_the_ID(), 'tainacan-small') ?>" class="img-fluid rounded-circle" alt="">
<img src="<?php echo get_the_post_thumbnail_url(get_the_ID(), 'collection-list-card') ?>" class="tainacan-list-collection--card-img rounded-0 align-self-center mr-3" alt="">
<?php else : ?>
<div class="image-placeholder">
<h4>
@ -28,17 +19,18 @@
</h4>
</div>
<?php endif; ?>
</td>
<td class="collection-title text-black"><?php the_title(); ?></td>
<td class="collection-description text-oslo-gray"><?php the_excerpt(); ?></td>
<!-- <td class="collection-date text-oslo-gray"><?php //echo get_the_date(); ?></td>
<td class="collection-create-by text-oslo-gray"><?php //_e('Created by', 'tainacan-theme'); ?> <?php the_author_posts_link(); ?></td> -->
</tr>
<?php endwhile; ?>
</tbody>
</table>
<div class="media-body text-oslo-gray">
<p><?php echo get_the_excerpt(); ?></p>
<p>
<?php _e('Create by: ');?> <?php the_author(); ?><br>
<?php _e('Date: ');?> <?php tainacan_post_date(); ?>
</p>
</div>
</div>
</a>
</div>
<?php endwhile; ?>
</div>
</div>
<?php echo tainacan_pagination(3); ?>