Skip to content

Instantly share code, notes, and snippets.

View NicBeltramelli's full-sized avatar
🏊‍♂️
Swimming

Nic Beltramelli NicBeltramelli

🏊‍♂️
Swimming
View GitHub Profile
@NicBeltramelli
NicBeltramelli / function.php
Last active June 20, 2017 08:20
Genesis customize the Author Box
<?php
/**
* Customize Genesis Author Box
* @author Nic Beltramelli
*/
add_filter( 'genesis_author_box', function ($output, $context, $pattern, $gravatar, $title, $description) {
if( 'single' == $context ) {
@NicBeltramelli
NicBeltramelli / functions.php
Last active August 23, 2017 18:02 — 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.
@NicBeltramelli
NicBeltramelli / _wordpress.scss
Last active January 4, 2019 14:31
Add support for Gutenberg color palette for Genesis Advanced
/* Color Palette */
.has-dark-background-color {
background-color: color(dark, base);
}
.has-dark-color {
color: color(dark, base);
}
@NicBeltramelli
NicBeltramelli / function.php
Last active February 12, 2019 15:12
Change number of thumbnails per row on WooCommerce product gallery.
<?php
// Do NOT include the opening php tag.
/**
* Change number of thumbnails per row on product gallery
*
* @author Nic Beltramelli
*
* @param array $wrapper_classes The number of thumbnails per row.
* @return array The modified wrapper class.
@NicBeltramelli
NicBeltramelli / function.php
Created February 13, 2019 16:14
Reposition jetpack sharing buttons below the title for Genesis framework
<?php
// Do NOT include the opening php tag.
/**
* Reposition jetpack sharing buttons below the title
*
* @author Nic Beltramelli
*
*/
add_action(
@NicBeltramelli
NicBeltramelli / function.php
Created February 13, 2019 16:18
Reposition jetpack sharing buttons below the title on WooCommerce product page
<?php
// Do NOT include the opening php tag.
/**
* Reposition sharing buttons below the title on product page
*
* @author Nic Beltramelli
*/
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_sharing', 50 );
@NicBeltramelli
NicBeltramelli / function.php
Created February 14, 2019 09:43
Customize the Genesis post meta function for post and WooCommerce product post types
<?php
// Do NOT include the opening php tag.
/**
* Customize the post meta function
*
* @author Nic Beltramelli
*
* @param array $post_meta Default post meta fields.
* @return array Custom post meta fields.
@NicBeltramelli
NicBeltramelli / function.php
Created February 14, 2019 20:23
Change the WooCommerce product category image size
<?php
// Do NOT include the opening php tag.
/**
* Change the WooCommerce product category image size
*
* @author Nic Beltramelli
*/
add_filter(
'subcategory_archive_thumbnail_size', function ( $small_thumbnail_size ) {
@NicBeltramelli
NicBeltramelli / WP_Query.php
Created February 18, 2019 12:11 — forked from Dimasmagadan/WP_Query.php
#WordPress query with args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
//////Author Parameters - Show posts associated with certain author.
@NicBeltramelli
NicBeltramelli / function.php
Created February 18, 2019 14:43
WooCommerce display product category image on category archive
<?php
// Do NOT include the opening php tag.
/**
* Display category image on WooCommerce category archive
*
* @author Nic Beltramelli
*/
add_action(
'woocommerce_archive_description', function () {