Skip to content

Instantly share code, notes, and snippets.

View mparraud's full-sized avatar
🏠
Working from home

Miguel Parraud Cordeyro mparraud

🏠
Working from home
View GitHub Profile
@cdils
cdils / archive-testimonials-grid.php
Last active April 25, 2018 16:08 — forked from billerickson/grid-loop.php
Use this grid loop in a custom page template to show page content, followed by a loop through a custom post type.
<?php
/**
* Template Name: Testimonial Archives
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
@wpsmith
wpsmith / functions.php
Created February 14, 2013 05:10
Remove Genesis Breadcrumbs Conditionally
<?php
/**
* I used genesis_before, but you can also use get_header or other hooks as long
* as you call the check function prior to the breadcrumbs being called.
*/
add_action( 'genesis_before', 'wps_remove_genesis_breadcrumbs' );
/**
* Remove Genesis Breadcrumbs from all but 1 category.
*/
@srikat
srikat / functions.php
Last active April 22, 2021 11:48
Showing a different menu in Primary Navigation location conditionally in Genesis
<?php
//* Do NOT include the opening php tag
add_action( 'genesis_before', 'sk_replace_menu_in_primary' );
/**
* Conditionally replace Custom Menu in Primary Navigation.
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/conditionally-replace-navigation-menu-genesis/
*/
<?php
//* Do NOT include the opening php tag
//* Add multiple grid loops to a page template*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
function custom_do_grid_loop() {
$args = array(
@About2git
About2git / functions.php
Last active September 16, 2021 18:54 — forked from srikat/functions.php
Shrinking header in Genesis similar to that in Centric Pro
//* Enqueue Scripts
add_action( 'wp_enqueue_scripts', 'custom_load_scripts' );
function custom_load_scripts() {
wp_enqueue_script( 'shrinking-header', get_bloginfo( 'stylesheet_directory' ) . '/js/shrinking-header.js', array( 'jquery' ), '1.0.0', true );
}
@idavinder
idavinder / Add multiple Google Fonts to Genesis Theme
Created May 25, 2015 07:42
Add multiple Google Fonts to Genesis Theme
//* Add multiple Google Fonts in Genesis - http://www.basicwp.com/?p=2054
add_action( 'wp_enqueue_scripts', 'genesis_ig_multiple_google_fonts' );
function genesis_ig_multiple_google_fonts() {
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato|Open+Sans|Oswald:400,300,700', array(), CHILD_THEME_VERSION );
}
@pradeepdotco
pradeepdotco / functions.php
Last active May 26, 2022 23:41
Add Featured Image Genesis
/* Code to Display Featured Image on top of the post */
add_action( 'genesis_before_entry', 'featured_post_image', 8 );
function featured_post_image() {
if ( ! is_singular( 'post' ) ) return;
the_post_thumbnail('post-image');
}
@dannyconnolly
dannyconnolly / translate_woocommerce.php
Created December 18, 2015 13:22
Change SKU text label in woocommerce to Product Code
function translate_woocommerce($translation, $text, $domain) {
if ($domain == 'woocommerce') {
switch ($text) {
case 'SKU':
$translation = 'Product Code';
break;
case 'SKU:':
$translation = 'Product Code:';
break;
@lukecav
lukecav / add-to-cart.php
Last active March 25, 2024 06:59
Display Product Variations in the Shop Loop - With Conditional Apply Filter Logic
<?php
/**
* Custom Loop Add to Cart.
*
* Template with quantity and ajax.
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
global $product;
@woogists
woogists / wc-change-currency-symbol.php
Last active April 18, 2024 08:10
Change a currency symbol
/**
* Change a currency symbol
*/
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);
function change_existing_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'AUD': $currency_symbol = 'AUD$'; break;
}
return $currency_symbol;