Skip to content

Instantly share code, notes, and snippets.

@rachelmccollin
Last active February 13, 2018 14:55
Show Gist options
  • Save rachelmccollin/79539241c0c4f5ab7051d036ada3efaf to your computer and use it in GitHub Desktop.
Save rachelmccollin/79539241c0c4f5ab7051d036ada3efaf to your computer and use it in GitHub Desktop.
WPMU DEV Landing pages
<section class="colophon" role="contentinfo">
<small class="copyright left">
<?php echo compass_copyright(); ?>
<?php if ( ! is_page_template ( 'landing-page.php' ) ) { ?>
<a href="<?php echo home_url( '/' ) ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<?php bloginfo( 'name'); ?>
</a>
<?php } else {
<?php bloginfo( 'name'); ?>
<?php } ?>
</small><!-- #copyright -->
<small class="credits right">
Proudly powered by <a href="http://wordpress.org/">WordPress</a>.
</a>
</small><!-- #credits -->
</section><!--#colophon-->
<section class="colophon" role="contentinfo">
<small class="copyright left">
<?php echo compass_copyright(); ?>
<a href="<?php echo home_url( '/' ) ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<?php bloginfo( 'name'); ?>
</a>
</small><!-- #copyright -->
<small class="credits right">
Proudly powered by <a href="http://wordpress.org/">WordPress</a>.
</a>
</small><!-- #credits -->
</section><!--#colophon-->
<hgroup class="site-name one-third left">
<!-- site name and description - site name is inside a div element on all pages execpt the front page and/or main blog page, where it is in a h1 element -->
<h1 id="site-title" class="one-half-left">
<?php if ( is_page_template( 'landing-page.php' ) ) {
bloginfo( 'name' );
}
else { ?>
<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<?php bloginfo( 'name' ); ?>
</a>
<?php } ?>
</h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<hgroup class="site-name one-third left">
<!-- site name and description - site name is inside a div element on all pages execpt the front page and/or main blog page, where it is in a h1 element -->
<h1 id="site-title" class="one-half-left">
<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
</h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<?php
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><?php the_title(); ?></h2>
<section class="featured-image one-third left">
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail( 'medium' );
} ?>
</section>
<section class="entry-content right two-thirds">
<?php the_content(); ?>
</section><!-- .entry-content -->
</article><!-- #post-## -->
<?php endwhile; ?>
<?php if ( ! is_page_template( 'landing-page.php' ) ) { ?>
<nav class="menu main right">
<div class="skip-link screen-reader-text">
<a href="#content" title="<?php esc_attr_e( 'Skip to content', 'compass' ); ?>">
<?php _e( 'Skip to content', 'rmcc' ); ?>
</a>
</div>
<?php wp_nav_menu( array( 'container_class' => 'main-nav', 'theme_location' => 'primary' ) ); ?>
</nav><!-- .main -->
<?php } ?>
<nav class="menu main right">
<div class="skip-link screen-reader-text">
<a href="#content" title="<?php esc_attr_e( 'Skip to content', 'compass' ); ?>">
<?php _e( 'Skip to content', 'rmcc' ); ?>
</a>
</div>
<?php wp_nav_menu( array( 'container_class' => 'main-nav', 'theme_location' => 'primary' ) ); ?>
</nav><!-- .main -->
<?php
/**
* The template for displaying all pages.
*/
get_header(); ?>
<?php
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( has_post_thumbnail() ) { ?>
<h2 class="entry-title desktop"><?php the_title(); ?></h2>
<div class="quarter right">
<?php the_post_thumbnail( 'large' ); ?>
</div>
<section class="entry-content three-quarters left">
<h2 class="entry-title mobile"><?php the_title(); ?></h2>
<?php the_content(); ?>
</section><!-- .entry-content -->
<?php }
else { ?>
<h2 class="entry-title desktop"><?php the_title(); ?></h2>
<section class="entry-content">
<?php the_content(); ?>
</section><!-- .entry-content -->
<?php } ?>
</article><!-- #post-## -->
<?php endwhile; ?>
?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
/**
* Template Name: Landing page
* The template for displaying the landing page.
*
*/
#content {
width: 65%;
float: left;
}
.sidebar {
width: 32%;
float: right;
}
.page-template-landing-page #content {
width: 100%;
float: none;
}
<?php if ( has_post_thumbnail() ) { ?>
<h2 class="entry-title desktop"><?php the_title(); ?></h2>
<div class="quarter right">
<?php the_post_thumbnail( 'large' ); ?>
</div>
<section class="entry-content three-quarters left">
<h2 class="entry-title mobile"><?php the_title(); ?></h2>
<?php the_content(); ?>
</section><!-- .entry-content -->
<?php }
else { ?>
<h2 class="entry-title desktop"><?php the_title(); ?></h2>
<section class="entry-content">
<?php the_content(); ?>
</section><!-- .entry-content -->
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment