Skip to content

Instantly share code, notes, and snippets.

View geeac's full-sized avatar

Eugenia Cosinschi geeac

View GitHub Profile
@cartpauj
cartpauj / memberpress-footer-tracking-script-thank-you-page.php
Created May 1, 2019 19:23
MemberPress footer tracking scripts on the thank you page
@fldtrace
fldtrace / functions.php
Last active July 3, 2021 18:26
Better, Faster, Responsive Images for Divi – Upload in Divi child theme.
<?php
// enable divi functions
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' );
function my_enqueue_assets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
//add 1440px image size
add_image_size('image_1440', 1440, 9999, false);
@deckerweb
deckerweb / functions.php
Created April 17, 2017 19:39 — forked from ChrisCree/functions.php
Add the Shop page breadcrumb to single products and archives for WooCommerce pages with the Genesis framework. Code below can be added to your child theme's functions.php file. Then go to Genesis --> Theme Settings and ensure the Breadcrumbs settings for Posts and Archives is enabled. PLEASE NOTE: This code assumes the Genesis Connect for WooCom…
<?php
// Do not copy opening PHP tag above
// Add the Shop page to Genesis breadcrumbs in WooCommerce
// NOTE: Assumes Genesis Connect for WooCommerce plugin is active
add_filter( 'genesis_archive_crumb', 'wsm_prepend_shop_link', 11, 2 );
add_filter( 'genesis_single_crumb', 'wsm_prepend_shop_link', 11, 2 );
function wsm_prepend_shop_link( $crumb, $args ) {
if ( is_singular( 'product' ) || is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) {
@cartpauj
cartpauj / mepr-ecommerce.php
Last active January 17, 2024 22:11
Google eCommerce Tracking for MemberPress Thank You Pages
<?php
//PASTE THIS CODE IN A PLUGIN LIKE My Custom Functions (RECOMMENDED) OR IN YOUR THEME'S functions.php FILE
//THIS ASSUMES YOU HAVE THE GOOGLE ANALYTICS JAVASCRIPT INCLUDED ALREADY
function echo_ga_tracking_script() {
if(isset($_GET['membership']) && isset($_GET['trans_num'])) {
$txn = MeprTransaction::get_one_by_trans_num($_GET['trans_num']);
if(isset($txn->id) && $txn->id > 0) {
//Echo the script to the HTML <head>
?>
@woogist
woogist / genesis-functions.php
Last active December 20, 2017 01:51
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' );
@jonathan-dejong
jonathan-dejong / wpseo-and-BTF
Last active May 9, 2019 07:39
Example of using WordPress SEO By Yoast filters with Beautiful Taxonomy Filters
<?php
/* This file is taken directly from a clients site so it contains strings and conditions not necessarily useful to anyone else.
However it does show how one can use these filters to modify the meta information for the different filtered results */
/* CHANGE META DESCRIPTION ON KLINIK FILTER PAGES */
add_filter('wpseo_metadesc', 'custom_metadesc', 10, 1);
function custom_metadesc($desc){
if(is_tax(array('omrade', 'yrkeskategori', 'specialisering', 'betalningsmedel', 'forsakringsbolag'))){
global $wp_query;
$termID = $wp_query->queried_object->term_id;
@bekarice
bekarice / edit-woocommerce-checkout-template.php
Last active March 27, 2023 23:12
Add content and notices to the WooCommerce checkout - sample code
/**
* Each of these samples can be used - note that you should pick one rather than add them all.
*
* How to use WC notices: https://github.com/woothemes/woocommerce/blob/master/includes/wc-notice-functions.php#L96
* Tutorial: http://www.skyverge.com/blog/edit-woocommerce-templates/
**/
/**
* Add a content block after all notices, such as the login and coupon notices.
*
@JiveDig
JiveDig / genesis_custom_loop.php
Last active March 4, 2020 15:33
wp_query using genesis_custom_loop. To alter content use standard genesis add_action and remove_action hooks
<?php
//* Custom loop WITH pagination
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'bhl_do_resident_query' );
function bhl_do_resident_query() {
global $paged;
global $query_args;
@srikat
srikat / functions.php
Last active March 20, 2017 15:08
How to add Beautiful Pro’s mobile responsive menu in other Genesis themes. http://sridharkatakam.com/add-beautiful-pros-mobile-responsive-menu-genesis-themes/
// Enqueue scripts and styles
add_action( 'wp_enqueue_scripts', 'custom_scripts_styles_mobile_responsive' );
function custom_scripts_styles_mobile_responsive() {
wp_enqueue_script( 'beautiful-responsive-menu', get_stylesheet_directory_uri() . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' );
wp_enqueue_style( 'dashicons' );
}
<?php
/**
* This file adds the category archive template.
*
*/
//* Force full width content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Remove the breadcrumb navigation