Skip to content

Instantly share code, notes, and snippets.

View j-mccarthy's full-sized avatar
💭
passing by

John McCarthy j-mccarthy

💭
passing by
  • flowethic
  • United Kingdom
View GitHub Profile
<?php // Remove the php tags
// load google webmaster meta
add_action( 'genesis_meta', 'load_google_webmaster_meta' );
function load_google_webmaster_meta() {
echo '<meta name="google-site-verification" content="aLw0qe25ZRJ0KxTWg48j-e2qC6f8927yGq5LBUvP9co" />';
}
<?php // Remove when using this snippet
function child_load_google_fonts() {
// Setup font arguments
$query_args = array(
'family' => 'Lato:300,400,500,700', // Notice the new 400 weight!!!
);
// A safe way to register a CSS style file for later use
wp_register_style( 'google-fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null );
Body {
font-weight: 400; // New font weight for better legibility
}
@media only screen and (max-width: 800px) {
body {
font-size: 16px; // Bring's more contrast to the font
font-weight: 300; // Back to defualt setting
}
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
<?php // <- Remove <?php if your using this snippet
/**
* CENTER CONTENT / BOTTOM SIDEBAR
*/
// Register New Layout
function jm_center_post_layout() {
genesis_register_layout( 'center-bottom', array(
'label' => __('Center/Bottom', 'genesis'),
<?php < Remove if just pulling this snippet into your functions.php file
//* Add Widgets to Site Tagline
add_action( 'genesis_after_header', 'new_widget' );
function new_widget() {
echo '<div class="new-widget_container">',
genesis_structural_wrap( 'new-widget' );
<?php
/**
* Sidebar Name
*
* @package John's Theme
* @since 0.0.2
* @link
* @author John McCarthy @ johnmccarthy.co
* @copyright Copyright (c) 2014, John McCarthy
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
<?php // <- Remove <?php if your using this snippet
// Register New Layout
function jm_custom_layout() {
genesis_register_layout( 'layout-name', array(
'label' => __('custom/layout/name', 'genesis'),
'img' => get_bloginfo('stylesheet_directory') . '/images/yourlayout.gif'
) );
}
add_action( 'init', 'jm_custom_layout' );
<?php // <- Remove <?php if your using this snippet
// Register New Layout
function jm_custom_layout() {
genesis_register_layout( 'layout-name', array(
'label' => __('custom/layout/name', 'genesis'),
'img' => get_bloginfo('stylesheet_directory') . '/images/yourlayout.gif'
) );
}
add_action( 'init', 'jm_custom_layout' );
<?php // <- Remove <?php if your using this snippet
// Hook in just before the main content-sidebar-wrap
add_action( 'genesis_before_content_sidebar_wrap', 'custom_layout_sidebar' );
function custom_layout_sidebar() {
$layout = genesis_site_layout();
// check to see if the custom layout exists
if( 'layout-name' == $layout ) {