Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Example of a mobile-first page with a Left Sidebar #70

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions hero.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

<div class="row">
<div class="small-12 large-8 columns" role="main">

<?php do_action('foundationPress_before_content'); ?>

<?php while (have_posts()) : the_post(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<header>
Expand All @@ -50,6 +50,8 @@

</div>

<aside id="sidebar" class="small-12 large-4 columns">
<?php get_sidebar(); ?>
</div>
</aside>
</div>
<?php get_footer(); ?>
42 changes: 42 additions & 0 deletions page-sidebar-left.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/*
Template Name: Sidebar Left
*/
get_header(); ?>

<?php get_header(); ?>

<div class="row">

<div class="small-12 large-8 large-push-4 columns" role="main">

<?php do_action('foundationPress_before_content'); ?>

<?php while (have_posts()) : the_post(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<header>
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>
<?php do_action('foundationPress_page_before_entry_content'); ?>
<div class="entry-content">
<?php the_content(); ?>
</div>
<footer>
<?php wp_link_pages(array('before' => '<nav id="page-nav"><p>' . __('Pages:', 'FoundationPress'), 'after' => '</p></nav>' )); ?>
<p><?php the_tags(); ?></p>
</footer>
<?php do_action('foundationPress_page_before_comments'); ?>
<?php comments_template(); ?>
<?php do_action('foundationPress_page_after_comments'); ?>
</article>
<?php endwhile;?>

<?php do_action('foundationPress_after_content'); ?>

</div>

<aside id="sidebar" class="small-12 large-4 large-pull-8 columns">
<?php get_sidebar(); ?>
</aside>
</div>
<?php get_footer(); ?>
6 changes: 4 additions & 2 deletions page.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<div class="row">
<div class="small-12 large-8 columns" role="main">

<?php do_action('foundationPress_before_content'); ?>

<?php while (have_posts()) : the_post(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<header>
Expand All @@ -27,6 +27,8 @@
<?php do_action('foundationPress_after_content'); ?>

</div>
<aside id="sidebar" class="small-12 large-4 columns">
<?php get_sidebar(); ?>
</aside>
</div>
<?php get_footer(); ?>
4 changes: 1 addition & 3 deletions sidebar.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<aside id="sidebar" class="small-12 large-4 columns">
<?php do_action('foundationPress_before_sidebar'); ?>
<?php dynamic_sidebar("sidebar-widgets"); ?>
<?php do_action('foundationPress_after_sidebar'); ?>
</aside>
<?php do_action('foundationPress_after_sidebar'); ?>
16 changes: 9 additions & 7 deletions single.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php get_header(); ?>
<div class="row">
<div class="small-12 large-8 columns" role="main">

<?php do_action('foundationPress_before_content'); ?>

<?php while (have_posts()) : the_post(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<header>
Expand All @@ -12,15 +12,15 @@
</header>
<?php do_action('foundationPress_post_before_entry_content'); ?>
<div class="entry-content">

<?php if ( has_post_thumbnail() ): ?>
<div class="row">
<div class="column">
<?php the_post_thumbnail('', array('class' => 'th')); ?>
</div>
</div>
<?php endif; ?>

<?php the_content(); ?>
</div>
<footer>
Expand All @@ -32,10 +32,12 @@
<?php do_action('foundationPress_post_after_comments'); ?>
</article>
<?php endwhile;?>

<?php do_action('foundationPress_after_content'); ?>

</div>
<?php get_sidebar(); ?>
</div>
<aside id="sidebar" class="small-12 large-4 columns">
<?php get_sidebar(); ?>
</aside>
</div>
<?php get_footer(); ?>