Skip to content

Instantly share code, notes, and snippets.

View danielmcclure's full-sized avatar

Daniel McClure danielmcclure

View GitHub Profile
<?php
//* Do NOT include the opening php tag
//* Unregister primary sidebar
unregister_sidebar( 'sidebar' );
<?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
@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' );
@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 / 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 / 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 / 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 / wc-change-number-of-related-products.php
Created June 21, 2018 22:39 — forked from woogists/wc-change-number-of-related-products.php
[Theming Snippets] Change number of related products output
@danielmcclure
danielmcclure / functions.php
Created June 25, 2018 02:27 — forked from srikat/functions.php
Adding a cart icon with number of items and total cost in nav menu when using WooCommerce. http://sridharkatakam.com/adding-cart-icon-number-items-total-cost-nav-menu-using-woocommerce/
//* Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' );
}
/**
* Place a cart icon with number of items and total cost in the menu bar.
@danielmcclure
danielmcclure / background-video.css
Created January 24, 2019 01:31 — forked from mwhiteley16/background-video.css
Background Video PHP
/* ---------- 6.1 Hero Video ---------- */
.home .page-header {
padding: 24rem 0 7rem;
height: 75vh;
overflow: hidden;
}
#bgvid {
position: absolute;
top: 0;
left: 0;