Skip to content

Instantly share code, notes, and snippets.

View jonbellah's full-sized avatar

Jon Bellah jonbellah

View GitHub Profile
@jonbellah
jonbellah / gist:4583383
Last active December 11, 2015 09:58
Custom footer with Genesis Framework
/** Customize the footer */
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5);
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15);
function child_custom_footer() {
if(is_front_page()) {?>
<footer>
<!-- Home page footer -->
@jonbellah
jonbellah / gist:4583404
Created January 21, 2013 03:25
Use Conditionals with WP Enqueue Script and Genesis
/** Load scripts on Portfolio page */
add_action('genesis_after_footer', 'child_load_portfolio');
function child_load_portfolio() {
if(is_page('Portfolio')) {
wp_register_script( 'isotope', get_bloginfo('stylesheet_directory').'/lib/js/jquery.isotope.min.js' );
wp_enqueue_script ( 'isotope' );
}
}
/** Isotope vars */
@jonbellah
jonbellah / gist:4585901
Created January 21, 2013 13:06
WP Enqueue Script at the bottom of the page with Genesis Framework
/** Remove script loading from header */
add_action('wp_enqueue_scripts', 'child_deregister_scripts');
function child_deregister_scripts() {
wp_deregister_script( 'jquery' );
wp_deregister_script( 'jquery-ui' );
}
/** Load scripts before closing the body tag */
add_action('genesis_after_footer', 'child_script_managment');
function child_script_managment() {
@jonbellah
jonbellah / gist:4585923
Created January 21, 2013 13:11
Genesis Custom Header for Multiple Page Layouts and Templates
/** Custom header */
remove_action('genesis_header', 'genesis_do_header');
remove_action('genesis_header', 'genesis_header_markup_open', 5);
remove_action('genesis_header', 'genesis_header_markup_close', 15);
function child_custom_header() {
if (is_front_page()) { ?>
YOUR HTML HERE
<?php }
elseif (is_page() || is_search() || is_archive() || is_home()) { ?>
@jonbellah
jonbellah / gist:4586003
Created January 21, 2013 13:23
Sticky Footer for the Genesis Framework
html, body {
height: 100%;
}
/*Opera Fix*/
body:before {
content:"";
height:100%;
float:left;
width:0;
@jonbellah
jonbellah / gist:4749788
Last active December 12, 2015 09:09
Make links fade in and out
a {
color: #333;
transition: color 0.2s linear;
-o-transition: color 0.2s linear;
-moz-transition: color 0.2s linear;
-webkit-transition: color 0.2s linear;
}
a:hover {
color: #289dd6;
@jonbellah
jonbellah / gist:5397139
Created April 16, 2013 15:56
Designing for Retina: CSS and background-images
@media (-webkit-max-device-pixel-ratio: 1),
(max-resolution: 119.9dpi) {
.logo {
background:url(images/example.jpg);
}
}
@media (-webkit-min-device-pixel-ratio: 1.1),
(min-resolution: 120dpi) {
.logo {
@jonbellah
jonbellah / Single media query
Created April 16, 2013 15:57
Designing for Retina: CSS and background-images
.logo {
background: url(images/example.jpg);
}
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
.logo {
background: url(images/[email protected]);
background-size: 100px 100px;
}
@jonbellah
jonbellah / gist:5462674
Last active December 16, 2015 16:19
Random Image with PHP
<img src="http://www.example.com/images/image-<?php echo rand(1,7); ?>.jpg">
@jonbellah
jonbellah / functions.php
Created May 15, 2013 18:50
Integrating isotope with custom post types - the functions.php code
/** Set up custom taxonomy query */
function custom_taxonomies_terms_links() {
global $post, $post_id;
// get post by post id
$post = &get_post($post->ID);
// get post type by post
$post_type = $post->post_type;
// get post type taxonomies
$taxonomies = get_object_taxonomies($post_type);
foreach ($taxonomies as $taxonomy) {