Skip to content

Commit

Permalink
Bug fix, added equal height div script
Browse files Browse the repository at this point in the history
  • Loading branch information
jlavoie13 committed Jan 12, 2015
1 parent a407b19 commit b8e7d3f
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 79 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Expand Up @@ -15,6 +15,7 @@
* Updated custom-post-type.php example with new constants, and functions for interaction messages and contextual help
* Removed iCheck, too many problems
* Improved magnific popup script in scripts.js to work with built-in WordPress gallery
* Added "equal height" div script
* Improved main navigation functionality and styles
* Responsive style improvements
* Form style improvements
Expand Down
2 changes: 1 addition & 1 deletion css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion footer.php
Expand Up @@ -19,7 +19,7 @@

</div><?php // END #content ?>

<footer id="colophon" class="footer" role="content-info">
<footer id="colophon" class="footer" role="contentinfo">

<div id="inner-footer" class="wrap clearfix">

Expand Down
72 changes: 1 addition & 71 deletions functions.php
Expand Up @@ -34,7 +34,6 @@
* 10.4 - Add news feed widget
* 10.5 - Change name of "Posts" in admin menu
* 10.6 - Customize footer
* 10.7 - Add theme page
* 11.0 - Custom/Additional Functions
*/

Expand All @@ -48,6 +47,7 @@
require_once( SCAFFOLDING_INCLUDE_PATH . 'base-functions.php' );
require_once( SCAFFOLDING_INCLUDE_PATH . 'custom-post-type.php' );
//require_once( SCAFFOLDING_INCLUDE_PATH . 'tinymce-settings.php' );
//require_once( SCAFFOLDING_INCLUDE_PATH . 'theme-guide.php' );


/************************************
Expand Down Expand Up @@ -591,7 +591,6 @@ function scaffolding_get_the_author_posts_link() {
* 10.4 - Add news feed widget
* 10.5 - Change name of "Posts" in admin menu
* 10.6 - Customize footer
* 10.7 - Add theme page
************************************/

// Set up the content width value based on the theme's design
Expand Down Expand Up @@ -722,75 +721,6 @@ function scaffolding_custom_admin_footer() {
}
add_filter( 'admin_footer_text', 'scaffolding_custom_admin_footer' );

/**
* Scaffolding theme page html
*
* @since Scaffolding 1.1
*/
function scaffolding_theme_page() { ?>
<div class="wrap">
<h2>Scaffolding Theme Guide</h2>
<ul>
<li>Here you can add theme specific instructions for clients;</li>
<li>Show content to specific users by capability or role;</li>
<li>Or do something completely different.</li>
</ul>
<strong>Resources</strong>
<ol>
<li><a href="http://scaffolding.io" target="_blank">Scaffolding Theme</a></li>
<li><a href="http://codex.wordpress.org" target="_blank">WordPress Codex</a></li>
<?php if ( class_exists( 'Woocommerce' ) ) { ?>
<li><a href="http://docs.woothemes.com/documentation/plugins/woocommerce/" target="_blank">WooCommerce</a></li>
<?php } ?>
</ol>
<strong>Theme Supports</strong>
<ol>
<?php if ( current_theme_supports( 'post-thumbnails' ) ) { ?>
<li>Post Thumbnails</li>
<?php } ?>
<?php if ( current_theme_supports( 'post-formats' ) ) { ?>
<li>Post Formats</li>
<?php } ?>
<?php if ( current_theme_supports( 'custom-header' ) ) { ?>
<li>Custom Headers</li>
<?php } ?>
<?php if ( current_theme_supports( 'custom-background' ) ) { ?>
<li>Custom Background</li>
<?php } ?>
<?php if ( current_theme_supports( 'menus' ) ) { ?>
<li>Menus</li>
<?php } ?>
<?php if ( current_theme_supports( 'automatic-feed-links' ) ) { ?>
<li>RSS Feed</li>
<?php } ?>
<?php if ( current_theme_supports( 'editor-style' ) ) { ?>
<li>Custom Editor Styles</li>
<?php } ?>
<?php if ( current_theme_supports( 'widgets' ) ) { ?>
<li>Widgets</li>
<?php } ?>
<?php if ( current_theme_supports( 'html5' ) ) { ?>
<li>HTML5</li>
<?php } ?>
<?php if ( current_theme_supports( 'title-tag' ) ) { ?>
<li>Title Tags</li>
<?php } ?>
</ol>
</div>
<?php
} // end scaffolding_theme_page()

/**
* Add scaffolding theme page in appearances dropdown menu
*
* @see scaffolding_theme_page
* @since Scaffolding 1.1
*/
function scaffolding_theme_menu() {
add_theme_page( 'Scaffolding Theme', 'Scaffolding Guide', 'edit_theme_options', 'scaffolding_theme_guide', 'scaffolding_theme_page' );
}
add_action( 'admin_menu', 'scaffolding_theme_menu' );


/************************************
* 11.0 CUSTOM/ADDITIONAL FUNCTIONS
Expand Down
6 changes: 4 additions & 2 deletions home.php
Expand Up @@ -31,8 +31,10 @@
</section>

<footer class="article-footer">

<p class="tags"><?php the_tags( '<span class="tags-title">' . __( 'Tags:', 'scaffolding' ) . '</span> ', ', ', '' ); ?></p>

<?php if ( get_the_tag_list() ) :
echo get_the_tag_list( '<p class="tags"><span class="meta-title">Tags:</span> ', ', ', '</p>' );
endif; ?>

</footer>

Expand Down
2 changes: 1 addition & 1 deletion includes/base-functions.php
Expand Up @@ -181,7 +181,7 @@ function scaffolding_first_last_menu_classes( $objects, $args ) {
$parent_ids = array();
$top_ids = array();

if ( ! emtpy( $objects ) ) {
if ( ! empty( $objects ) ) {

foreach ( $objects as $i => $object ) {
// If there is no menu item parent, store the ID and skip over the object.
Expand Down
78 changes: 78 additions & 0 deletions includes/theme-guide.php
@@ -0,0 +1,78 @@
<?php
/**
* Create a Custom Theme Guide
*
* This may be useful for clients as a user guide.
* Edit however it may suit your needs.
*
* @since Scaffolding 1.1
*/

/**
* Scaffolding theme page html
*
* @since Scaffolding 1.1
*/
function scaffolding_theme_page() { ?>
<div class="wrap">
<h2>Scaffolding Theme Guide</h2>
<ul>
<li>Here you can add theme specific instructions for clients;</li>
<li>Show content to specific users by capability or role;</li>
<li>Or do something completely different.</li>
</ul>
<strong>Resources</strong>
<ol>
<li><a href="http://scaffolding.io" target="_blank">Scaffolding Theme</a></li>
<li><a href="http://codex.wordpress.org" target="_blank">WordPress Codex</a></li>
<?php if ( class_exists( 'Woocommerce' ) ) { ?>
<li><a href="http://docs.woothemes.com/documentation/plugins/woocommerce/" target="_blank">WooCommerce</a></li>
<?php } ?>
</ol>
<strong>Theme Supports</strong>
<ol>
<?php if ( current_theme_supports( 'post-thumbnails' ) ) { ?>
<li>Post Thumbnails</li>
<?php } ?>
<?php if ( current_theme_supports( 'post-formats' ) ) { ?>
<li>Post Formats</li>
<?php } ?>
<?php if ( current_theme_supports( 'custom-header' ) ) { ?>
<li>Custom Headers</li>
<?php } ?>
<?php if ( current_theme_supports( 'custom-background' ) ) { ?>
<li>Custom Background</li>
<?php } ?>
<?php if ( current_theme_supports( 'menus' ) ) { ?>
<li>Menus</li>
<?php } ?>
<?php if ( current_theme_supports( 'automatic-feed-links' ) ) { ?>
<li>RSS Feed</li>
<?php } ?>
<?php if ( current_theme_supports( 'editor-style' ) ) { ?>
<li>Custom Editor Styles</li>
<?php } ?>
<?php if ( current_theme_supports( 'widgets' ) ) { ?>
<li>Widgets</li>
<?php } ?>
<?php if ( current_theme_supports( 'html5' ) ) { ?>
<li>HTML5</li>
<?php } ?>
<?php if ( current_theme_supports( 'title-tag' ) ) { ?>
<li>Title Tags</li>
<?php } ?>
</ol>
</div>
<?php
} // end scaffolding_theme_page()

/**
* Add scaffolding theme page in appearances dropdown menu
*
* @see scaffolding_theme_page
* @since Scaffolding 1.1
*/
function scaffolding_theme_menu() {
add_theme_page( 'Scaffolding Theme', 'Scaffolding Guide', 'edit_theme_options', 'scaffolding_theme_guide', 'scaffolding_theme_page' );
}
add_action( 'admin_menu', 'scaffolding_theme_menu' );
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -56,7 +56,7 @@

<?php else : ?>

<?php get_template_part ('templates/include', 'error' ); // WordPress template error message ?>
<?php get_template_part ( 'templates/include', 'error' ); // WordPress template error message ?>

<?php endif; ?>

Expand Down
32 changes: 32 additions & 0 deletions js/scripts.js
Expand Up @@ -114,6 +114,38 @@ jQuery(document).ready(function($) {
.height(newWidth * $el.attr('data-aspectRatio'));
});
}).resize();

// Equal Height Divs - http://css-tricks.com/equal-height-blocks-in-rows/
equalheight = function(container){

var currentTallest = 0,
currentRowStart = 0,
rowDivs = new Array(),
$el,
topPosition = 0;

$(container).each(function() {
$el = $(this);
$($el).height('auto')
topPostion = $el.position().top;

if (currentRowStart != topPostion) {
for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
rowDivs[currentDiv].height(currentTallest);
}
rowDivs.length = 0; // empty the array
currentRowStart = topPostion;
currentTallest = $el.height();
rowDivs.push($el);
} else {
rowDivs.push($el);
currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest);
}
for (currentDiv = 0 ; currentDiv < rowDivs.length ; currentDiv++) {
rowDivs[currentDiv].height(currentTallest);
}
});
}

/*
Responsive jQuery is a tricky thing.
Expand Down
2 changes: 1 addition & 1 deletion page.php
Expand Up @@ -10,7 +10,7 @@

get_header(); ?>

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article">

Expand Down
2 changes: 1 addition & 1 deletion scss/editor-styles.scss
Expand Up @@ -18,4 +18,4 @@ custom styles here.

.mceContentBody {
background-color: #FDFDFD;
}
}

0 comments on commit b8e7d3f

Please sign in to comment.