This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Template Name: Test */ | |
/** | |
* Genesis custom loop | |
*/ | |
function be_custom_loop() { | |
global $post; | |
// arguments, adjust as needed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* From css-tricks.com | |
* http://css-tricks.com/snippets/css/media-queries-for-standard-devices/ | |
*/ | |
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Move Yoast to bottom | |
function yoasttobottom() { | |
return 'low'; | |
} | |
add_filter( 'wpseo_metabox_prio', 'yoasttobottom'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Add Post categories above Post title on single Posts | |
add_action ( 'genesis_entry_header', 'sk_show_category_name', 9 ); | |
function sk_show_category_name() { | |
if ( ! is_singular('post') ) | |
return; | |
echo do_shortcode('[post_categories before="Filed Under: "]'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Position post info above post title | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12); | |
add_action( 'genesis_entry_header', 'genesis_post_info', 9 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Removes the "shop" title on the main shop page | |
*/ | |
add_filter( 'woocommerce_show_page_title', '__return_false' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Is a WooCommerce Product Simple or Variable | |
* | |
* see http://wordpress.org/support/topic/condition-to-check-if-product-is-simple-or-variable | |
*/ | |
if( $product->is_type( 'simple' ) ){ | |
// a simple product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Hide ACF menu item from the admin menu | |
*/ | |
function remove_acf_menu() | |
{ | |
// provide a list of usernames who can edit custom field definitions here | |
$admins = array( | |
'levy-access', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mbn_get_stores_by_location( $zip, $radius ) { | |
global $wpdb; | |
$radius = intval( $radius ); | |
// we first need to get the source coordinates | |
$sql = "SELECT `latitude`, `longitude` FROM `wp_zip_codes` WHERE `zipcode` = '%s'"; | |
$coords = $wpdb->get_row( $wpdb->prepare( $sql, $zip ) ); | |
OlderNewer