Created
October 22, 2018 05:56
-
-
Save dikiyforester/ddb8b17341d501c688c3e0d09766d647 to your computer and use it in GitHub Desktop.
Template to display widget "Vantage - Home Latest Listings" always in a List view
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template to display widget "Vantage - Home Latest Listings". | |
* | |
* @package Vantage\Templates | |
* @since 4.0.0 | |
*/ | |
$items = $instance['items']; | |
set_query_var( 'listing_layout', 'list' ); | |
?> | |
<div class="row column"> | |
<div class="home-widget-head-wrap"> | |
<?php | |
if ( ! empty( $instance['header'] ) ) { | |
echo $instance['before_title'] . $instance['header'] . $instance['after_title']; | |
} | |
if ( ! empty( $instance['description'] ) ) { | |
echo '<p class="home-widget-description">' . $instance['description'] . '</p>'; | |
} | |
?> | |
</div> <!-- .home-widget-head-wrap --> | |
<div class="row listing-wrap small-up-1 medium-up-2 large-up-3"> | |
<?php while ( $items->have_posts() ) : $items->the_post(); ?> | |
<div class="column"> | |
<?php get_template_part( 'parts/content-item', get_post_type() ); ?> | |
</div> <!-- .column --> | |
<?php endwhile; ?> | |
</div> <!-- .row --> | |
</div> <!-- .row --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy this file to your child theme, to the
parts/
directory.small-up-1 medium-up-2 large-up-3
- it is how many columns you will see on small, medium and large screens.small-up-1
- always one column for all screenssmall-up-1 medium-up-2
- one column for small screens, two for all othersmall-up-1 medium-up-2 large-up-3
- one column for small screens, two for medium, three for large.Change it how you need.