Skip to content

Instantly share code, notes, and snippets.

Created June 18, 2016 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/fcf31890bf0a51536845a74c016b0c15 to your computer and use it in GitHub Desktop.
Save anonymous/fcf31890bf0a51536845a74c016b0c15 to your computer and use it in GitHub Desktop.
<?php
//* Start the engine
include_once( get_template_directory() . '/lib/init.php' );
//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' );
define( 'CHILD_THEME_VERSION', '2.2.2' );
//* Enqueue Google Fonts
add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
function genesis_sample_google_fonts() {
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:300,400,700', array(), CHILD_THEME_VERSION );
}
//* Add HTML5 markup structure
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );
//* Add Accessibility support
add_theme_support( 'genesis-accessibility', array( 'headings', 'drop-down-menu', 'search-form', 'skip-links', 'rems' ) );
//* Add viewport meta tag for mobile browsers
add_theme_support( 'genesis-responsive-viewport' );
//* Add support for custom background
add_theme_support( 'custom-background' );
//* Add support for 3-column footer widgets
add_theme_support( 'genesis-footer-widgets', 3 );
//* Customize the entire footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'sp_custom_footer' );
function sp_custom_footer() {
?>
<p>&copy; Copyright 2016 <a href="http://iselaespana.com/">IselaEspana.com</a> &middot;<a href="http://iselaespana.com/terms">Terms</a> &middot; <a href="http://iselaespana.com/privacy-policy/">Privacy Policy</a>&middot; <a href="http://iselaespana.com/disclaimer">Disclaimer</a> </p>
<?php
// This will remove support for post thumbnails on ALL Post Types
remove_theme_support( 'post-thumbnails' );
//* Add new image sizes
add_image_size('grid', 295, 300, TRUE);
}
function be_archive_post_class( $classes ) {
// Don't run on single posts or pages
if( is_singular() )
return $classes;
$classes[] = 'one-third';
global $wp_query;
if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 3 )
$classes[] = 'first';
return $classes;
}
add_filter( 'post_class', 'be_archive_post_class' );
function be_grid_loop_pagination( $query = false ) {
// If no query is specified, grab the main query
global $wp_query;
if( !isset( $query ) || empty( $query ) || !is_object( $query ) )
$query = $wp_query;
// Sections of site that should use grid loop
if( ! ( $query->is_home() || $query->is_archive() ) )
return false;
// Specify pagination
return array(
'features_on_front' => 5,
'teasers_on_front' => 6,
'features_inside' => 0,
'teasers_inside' => 12,
);
}
/**
* Remove items from grid posts
*
*/
function be_grid_post_customization() {
// make sure we're on a grid post
if( !in_array( 'one-third', get_post_class() ) )
return;
// Remove items we don't want
remove_action( 'genesis_post_content', 'genesis_do_post_content' );
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
}
add_action( 'genesis_before_post', 'be_grid_post_customization' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment