-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from INN/40-homepage-template
Initialize homepage, with menu
- Loading branch information
Showing
8 changed files
with
113 additions
and
8 deletions.
There are no files selected for viewing
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
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
Empty file.
1 change: 1 addition & 0 deletions
1
wp-content/themes/ipbs-largo/homepages/assets/less/homepage.less
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@import (reference) "../../../less/variables.less"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
include_once get_template_directory() . '/homepages/homepage-class.php'; | ||
|
||
class IPBS extends Homepage { | ||
const menu_location = 'homepage_quick_links'; | ||
var $name = 'IPBS'; | ||
var $type = 'ipbs'; | ||
var $description = 'The homepage for IPBS.'; | ||
var $rightRail = false; | ||
|
||
public function __construct( $options = array() ) { | ||
$defaults = array( | ||
'template' => get_stylesheet_directory() . '/homepages/template.php', | ||
'assets' => array( | ||
array( | ||
'homepage', | ||
get_stylesheet_directory_uri() . '/homepages/assets/css/homepage.css', | ||
array(), | ||
filemtime( get_stylesheet_directory() . '/homepages/assets/css/homepage.css' ), | ||
), | ||
), | ||
'prominenceTerms' => array( | ||
array( | ||
'name' => __('Homepage Top Story', 'largo'), | ||
'description' => __('If you are using a "Big story" homepage layout, add this label to a post to make it the top story on the homepage', 'largo'), | ||
'slug' => 'top-story' | ||
), | ||
), | ||
'sidebars' => array( | ||
'Homepage Bottom (The bottom area of the homepage, after the top and featured stories)', | ||
), | ||
); | ||
$options = array_merge( $defaults, $options ); | ||
|
||
$this->register_nav_menu(); | ||
$this->load( $options ); | ||
} | ||
|
||
/** | ||
* @link https://developer.wordpress.org/reference/functions/register_nav_menu/ | ||
*/ | ||
public static function register_nav_menu() { | ||
register_nav_menu( IPBS::menu_location, __( 'Homepage Quick Links', 'ipbs' ) ); | ||
} | ||
} | ||
|
||
/** | ||
* Register this layout with Largo | ||
*/ | ||
function ipbs_homepage_layout() { | ||
register_homepage_layout( 'ipbs' ); | ||
} | ||
add_action( 'init', 'ipbs_homepage_layout' ); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
global $shown_ids; | ||
$topstory = largo_home_single_top(); | ||
$shown_ids[] = $topstory->ID; | ||
|
||
?> | ||
<div class=""> | ||
<?php | ||
// note that we're making a section containing a background image, | ||
// which goes behind a transparent section that contains: | ||
// - the article heading | ||
// - the article excerpt | ||
// - a "Quick links" menu for the site | ||
?> | ||
<div id="top-story" <?php post_class( '', $topstory->ID ); ?> > | ||
<div class="post-image-top-term-container"> | ||
<?php | ||
// The top term | ||
largo_maybe_top_term(); | ||
?> | ||
<a class="img" href="<?php echo esc_attr( get_permalink( $topstory ) ); ?>"><?php echo get_the_post_thumbnail( $topstory, 'large' ); ?></a> | ||
</div> | ||
<div class="inner"> | ||
<article <?php post_class( '', $topstory ); ?>> | ||
<h2><a href="<?php the_permalink( $topstory ); ?>"><?php echo get_the_title( $topstory ); ?></a></h2> | ||
<div class="excerpt"> | ||
<?php largo_excerpt( $topstory, 2 ); ?> | ||
<a class="view-more-link" href="<?php the_permalink( $topstory ); ?>">Full Story</a> | ||
</div> | ||
</article> | ||
<?php | ||
wp_nav_menu( array( | ||
'theme_location' => IPBS::menu_location, | ||
) ); | ||
?> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="bottom-widget-area clearfix"> | ||
<div class="widget-area"> | ||
<?php | ||
dynamic_sidebar( 'Homepage Bottom' ); | ||
?> | ||
</div> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ Author URI: https://labs.inn.org | |
Template: largo | ||
Version: 0.1 | ||
*/ | ||
|
||
@import "variables.less"; |
Empty file.