Created
January 19, 2020 01:52
-
-
Save jojocode2/b79df6465ad62c1621c08d5ec1cb5836 to your computer and use it in GitHub Desktop.
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 get_header(); ?> | |
<div class="page-banner"> | |
<div class="page-banner__bg-image" style="background-image: url(<?php echo get_theme_file_uri('/images/library-hero.jpg') ?>);"></div> | |
<div class="page-banner__content container t-center c-white"> | |
<h1 class="headline headline--large">Welcome!,</h1> | |
<h2 class="headline headline--medium">We think you’ll like it here.</h2> | |
<h3 class="headline headline--small">Why don’t you check out the <strong>major</strong> you’re interested in?</h3> | |
<a href="#" class="btn btn--large btn--blue">Find Your Major</a> | |
</div> | |
</div> | |
<div class="full-width-split group"> | |
<div class="full-width-split__one"> | |
<div class="full-width-split__inner"> | |
<h2 class="headline headline--small-plus t-center">Upcoming Events</h2> | |
<?php | |
$homeEvents = new WP_Query(array( | |
'posts_per_page' => -1, | |
'post_type' => 'event', | |
'meta_key' => 'event_date', | |
'orderby' => 'meta_value_num', | |
'order' => 'ASC' | |
)); | |
while ($homeEvents -> have_posts()) { | |
$homeEvents -> the_post(); ?> | |
<div class="event-summary"> | |
<a class="event-summary__date t-center" href="#"> | |
<span class="event-summary__month"><?php | |
$eDate = new DateTime(get_field('event_date')); | |
echo $eDate->format('M'); | |
?></span> | |
<span class="event-summary__day"><?php echo $eDate->format('d'); ?></span> | |
</a> | |
<div class="event-summary__content"> | |
<h5 class="event-summary__title headline headline--tiny"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> | |
<p><p><?php if (has_excerpt()) { | |
the_excerpt(); | |
} | |
else { | |
echo wp_trim_words(get_the_content(), 30); | |
} | |
?> <a href="<?php the_permalink();?>" class="nu gray">Learn more</a></p> | |
</div> | |
</div> | |
<?php } | |
?> | |
<p class="t-center no-margin"><a href="<?php echo get_post_type_archive_link('event'); ?>" class="btn btn--blue">View All Events</a></p> | |
</div> | |
</div> | |
<div class="full-width-split__two"> | |
<div class="full-width-split__inner"> | |
<h2 class="headline headline--small-plus t-center">From Our Blogs</h2> | |
<?php | |
$hPosts = new WP_Query(array( | |
'posts_per_page' => 2 | |
)); | |
while ($hPosts->have_posts()) { | |
$hPosts->the_post(); ?> | |
<div class="event-summary"> | |
<a class="event-summary__date event-summary__date--beige t-center" href="<?php the_permalink(); ?>"> | |
<span class="event-summary__month"><?php the_time('M'); ?></span> | |
<span class="event-summary__day"><?php the_time('d'); ?></span> | |
</a> | |
<div class="event-summary__content"> | |
<h5 class="event-summary__title headline headline--tiny"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h5> | |
<p><?php if (has_excerpt()) { | |
the_excerpt(); | |
} | |
else { | |
echo wp_trim_words(get_the_content(), 30); | |
} | |
?> <a href="<?php the_permalink(); ?>" class="nu gray">Read more</a></p> | |
</div> | |
<?php } wp_reset_postdata(); ?> | |
<p class="t-center no-margin"><a href="<?php site_url('/blog'); ?></php>" class="btn btn--yellow">View All Blog Posts</a></p> | |
</div> | |
</div> | |
</div> | |
<div class="hero-slider"> | |
<div class="hero-slider__slide" style="background-image: url(<?php echo get_theme_file_uri('/images/bus.jpg') ?>);"> | |
<div class="hero-slider__interior container"> | |
<div class="hero-slider__overlay"> | |
<h2 class="headline headline--medium t-center">Free Transportation</h2> | |
<p class="t-center">All students have free unlimited bus fare.</p> | |
<p class="t-center no-margin"><a href="#" class="btn btn--blue">Learn more</a></p> | |
</div> | |
</div> | |
</div> | |
<div class="hero-slider__slide" style="background-image: url(<?php echo get_theme_file_uri('/images/apples.jpg') ?>);"> | |
<div class="hero-slider__interior container"> | |
<div class="hero-slider__overlay"> | |
<h2 class="headline headline--medium t-center">An Apple a Day</h2> | |
<p class="t-center">Our dentistry program recommends eating apples.</p> | |
<p class="t-center no-margin"><a href="#" class="btn btn--blue">Learn more</a></p> | |
</div> | |
</div> | |
</div> | |
<div class="hero-slider__slide" style="background-image: url(<?php echo get_theme_file_uri('/images/bread.jpg') ?>);"> | |
<div class="hero-slider__interior container"> | |
<div class="hero-slider__overlay"> | |
<h2 class="headline headline--medium t-center">Free Food</h2> | |
<p class="t-center">Fictional University offers lunch plans for those in need.</p> | |
<p class="t-center no-margin"><a href="#" class="btn btn--blue">Learn more</a></p> | |
</div> | |
</div> | |
</div> | |
</div> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment