beginning view modes

This commit is contained in:
Leo Germani 2018-05-29 11:04:00 -03:00
parent bf5da84b56
commit dfe5259ff6
2 changed files with 53 additions and 1 deletions

View File

@ -52,7 +52,15 @@ if(!function_exists('tainacan_setup')) {
'flex-width' => true,
);
add_theme_support( 'custom-logo', $logo_args );
if (function_exists('tainacan_register_view_mode')) {
tainacan_register_view_mode('cards', [
'label' => 'Cards view',
'description' => 'A Cards view',
'icon' => '<span class="icon"><i class="mdi mdi-view-list mdi-24px"></i></span>',
'dynamic_metadata' => true,
]);
}
}

View File

@ -0,0 +1,44 @@
<?php var_dump($request['fetch_only']); if (have_posts()): ?>
<div class="list-container">
<?php while (have_posts()): the_post(); ?>
<div class="tainacan-list">
<p class="field-main-content"><?php the_title(); ?></p>
<div>
<div class="list-image">
<?php the_post_thumbnail('thumbnail'); ?>
</div>
<div class="list-metadata">
<?php foreach ($request['fetch_only']['meta'] as $meta_id): ?>
<span>
<p>
<?php tainacan_the_metadata((int) $meta_id); ?>
</p>
</span>
<?php endforeach; ?>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<?php else: ?>
Nenhum item encontrado
<?php endif; ?>