Skip to content

Instantly share code, notes, and snippets.

View kontikidigital's full-sized avatar

Kontiki Digital kontikidigital

View GitHub Profile
@billerickson
billerickson / genesis-custom-loop-pagination.php
Created July 31, 2012 15:59
Genesis custom loop with pagination
<?php
/* Template Name: Test */
/**
* Genesis custom loop
*/
function be_custom_loop() {
global $post;
// arguments, adjust as needed
@hs0ucy
hs0ucy / media-queries-samples.css
Created September 21, 2012 17:48
Media Queries for Standard Devices
/*
* 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 */
@aderaaij
aderaaij / yoast
Last active April 3, 2024 20:11
Wordpress - Move yoast seo boxes to bottom of post/page
// Move Yoast to bottom
function yoasttobottom() {
return 'low';
}
add_filter( 'wpseo_metabox_prio', 'yoasttobottom');
@nutsandbolts
nutsandbolts / Force content-sidebar layout on blog (Genesis)
Last active July 24, 2018 16:04
Force content-sidebar layout on blog posts when your default layout is full-width content
//* Force sidebar on blog posts and archives
add_filter( 'genesis_pre_get_option_site_layout', 'nabm_force_layout' );
function nabm_force_layout( $opt ) {
if ( is_single() || is_archive() ) {
$opt = 'content-sidebar';
return $opt;
}
}
@srikat
srikat / functions.php
Created January 8, 2014 06:11
Moving Post Categories from Entry Meta to above Post Title in Genesis. http://sridharkatakam.com/moving-post-categories-entry-meta-post-title-genesis/
//* 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: "]');
}
//* Position post info above post title
remove_action( 'genesis_entry_header', 'genesis_post_info', 12);
add_action( 'genesis_entry_header', 'genesis_post_info', 9 );
@corsonr
corsonr / gist:8703820
Last active December 23, 2020 08:16
WooCommerce : Remove the "shop" title on the main shop page
<?php
/**
* Removes the "shop" title on the main shop page
*/
add_filter( 'woocommerce_show_page_title', '__return_false' );
@patrickgilmour
patrickgilmour / woocommerce-simple-or-variable.php
Created June 27, 2014 17:57
WooCommerce conditional to test if a Product is Simple or Variable.
<?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
@barbwiredmedia
barbwiredmedia / functions.php
Created July 15, 2014 20:42
Hide ACF menu item from the admin menu. wordpress functions.php
/**
* 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',
@daltonrooney
daltonrooney / get_stores_by_location.php
Last active June 29, 2023 14:14
Store locator with Advanced Custom Fields
<?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 ) );