This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************* | |
* Sensei Integration | |
*********************/ | |
/** | |
* Declare that your theme now supports Sensei | |
*/ | |
add_action( 'after_setup_theme', 'sensei_support' ); | |
function sensei_support() { | |
add_theme_support( 'sensei' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
NewerOlder