Skip to content

Instantly share code, notes, and snippets.

View davidperezgar's full-sized avatar

David Perez davidperezgar

View GitHub Profile
@davidperezgar
davidperezgar / woocommerce-move-price.php
Created October 18, 2016 11:05 — forked from AlphaBlossom/woocommerce-move-price.php
Move WooCommerce Pricing on Single Product Page
/**********************************
*
* Move WooCommerce Price on Single Product Page
*
* @author AlphaBlossom / Tony Eppright
* @link http://www.alphablossom.com
*
* Reference hook locations using woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title – 5
@davidperezgar
davidperezgar / change-style-load-order.php
Created October 18, 2016 11:03 — forked from cdils/change-style-load-order.php
Change order of where Genesis child theme stylesheet is loaded on theme initialization.
<?php //Remove this line
/**
* Remove Genesis child theme style sheet
* @uses genesis_meta <genesis/lib/css/load-styles.php>
*/
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
/**
* Enqueue Genesis child theme style sheet at higher priority
@davidperezgar
davidperezgar / functions.php
Created October 18, 2016 06:49
Set a default layout with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Set content/sidebar as the default layout
genesis_set_default_layout( 'content-sidebar' );
//* Set sidebar/content as the default layout
genesis_set_default_layout( 'sidebar-content' );
//* Set content/sidebar/sidebar as the default layout
@davidperezgar
davidperezgar / functions.php
Created October 18, 2016 06:45
Force a layout with the Genesis Framework.
<?php
//* Do NOT include the opening php tag
//* Force content-sidebar layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
//* Force sidebar-content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
//* Force content-sidebar-sidebar layout
@davidperezgar
davidperezgar / remove-sidebar-alt.php
Created October 7, 2016 07:17
Genesis Remove primary sidebar and changes to alternative
// Remove the Primary Sidebar from the Primary Sidebar area.
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' );
// Place the Secondary Sidebar into the Primary Sidebar area.
add_action( 'genesis_sidebar', 'genesis_do_sidebar_alt' );
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add post navigation (requires HTML5 theme support)
add_action( 'genesis_entry_footer', 'genesis_prev_next_post_nav' );
@davidperezgar
davidperezgar / wp-config.php
Last active October 5, 2016 10:02
WP Config for Local Site
<?php
define('DB_NAME', '');
define('DB_USER', 'root');
define('DB_PASSWORD', 'root');
define('WP_HOME', 'http://.loc/');
define('WP_SITEURL', 'http://.loc/');
define('DB_HOST', 'localhost');
define('FS_METHOD','direct');
define('WP_DEBUG', true);
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'pre-footer',
'name' => __( 'Before Footer Widgets', 'theme' ),
'description' => __( 'This is a Pre-Footer Widget area.', 'theme' ),
) );
add_action('genesis_before_footer', 'pre_footer_widget', 2 );
function pre_footer_widget() {
@davidperezgar
davidperezgar / custom-favicon.php
Last active September 26, 2016 11:22 — forked from studiopress/custom-favicon.php
Genesis images.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Display a custom favicon
add_filter( 'genesis_pre_load_favicon', 'cmk_favicon_filter' );
function cmk_favicon_filter( $favicon_url ) {
return get_stylesheet_directory_uri().'/images/favicon.png';
}
@davidperezgar
davidperezgar / genesis-remove-post-title.php
Created September 26, 2016 10:33
Genesis remove Post Title in home
/**
* @author David Perez - Closemarketing
* @example https://www.closemarketing.es/
*/
add_action('get_header', 'wpsites_remove_header');
function wpsites_remove_header() {
if (is_home()||is_front_page()) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
}
}