Skip to content

Instantly share code, notes, and snippets.

View danielmcclure's full-sized avatar

Daniel McClure danielmcclure

View GitHub Profile
@danielmcclure
danielmcclure / disable-woocommerce-3-zoom.php
Created June 21, 2018 22:37 — forked from corsonr/disable-woocommerce-3-zoom.php
Disable WooCommerce Product Image Zoom
<?php
/* Disable WooCommerce Product Image Zoom */
add_action( 'after_setup_theme', function() {
remove_theme_support( 'wc-product-gallery-zoom' );
}, 20 );
@danielmcclure
danielmcclure / redirection_export.php
Created April 30, 2018 01:28 — forked from mustafauysal/redirection_export.php
Export Yoast SEO Redirection rules
<?php
/**
* Generate redirection plugin (https://wordpress.org/plugins/redirection/) compatible csv files from Yoast SEO Premium's redirection.
*
* Usage: download and put this file to root directory of your WordPress installation.
* then visit the url, you will see the csv file :)
* after then WP Adming > Tools > Redirection > import (section)
*
*
* Don't use this file on production
@danielmcclure
danielmcclure / primary_category.php
Created January 18, 2017 03:18 — forked from jawinn/primary_category.php
Display Primary Category (Yoast's WordPress SEO)
<?php
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY
$category = get_the_category();
$useCatLink = true;
// If post has a category assigned.
if ($category){
$category_display = '';
$category_link = '';
if ( class_exists('WPSEO_Primary_Term') )
@danielmcclure
danielmcclure / functions.php
Last active December 17, 2016 17:57 — forked from SiR-DanieL/functions.php
Remove The Additional CSS Section from Customizer
/**
* Remove the additional CSS section, introduced in 4.7, from the Customizer.
* @param $wp_customize WP_Customize_Manager
*/
function mycustomfunc_remove_css_section( $wp_customize ) {
$wp_customize->remove_section( 'custom_css' );
}
add_action( 'customize_register', 'mycustomfunc_remove_css_section', 15 );
@danielmcclure
danielmcclure / genesis-functions.php
Last active August 29, 2015 14:25 — forked from woogist/genesis-functions.php
The code in below will integrate Sensei with the Genesis theme framework from Studio Press. Add the code below into your themes functions.php file.
/*********************
* Sensei Integration
*********************/
/**
* Declare that your theme now supports Sensei
*/
add_action( 'after_setup_theme', 'sensei_support' );
function sensei_support() {
add_theme_support( 'sensei' );
<?php
//* Do NOT include the opening php tag
//* Force content-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
//* Force sidebar-content layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
//* Force content-sidebar-sidebar layout setting
<?php
//* Do NOT include the opening php tag
//* Unregister primary sidebar
unregister_sidebar( 'sidebar' );