Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.
@webfocusdesign
webfocusdesign / 0_reuse_code.js
Created June 11, 2014 15:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@webfocusdesign
webfocusdesign / MSLS - functions.php
Created August 17, 2015 18:16
Multisite Language Switcher Code to "fix" strings between sites. I add this code to my child theme's functions.php or to my Dynamik skin's functions.php
//* Temporary fix/workaround for Multisite Language Switcher Links that are
//* not working with categories, author or WooCommerce pages. Uncomment as needed.
add_filter( 'msls_options_get_permalink', 'wfd_msls_options_get_permalink', 10, 2 );
function wfd_msls_options_get_permalink( $url, $language ) {
$url = str_replace( '/product-category/', '/categorie-produit/', $url );
$url = str_replace( '/products/', '/produits/', $url );
$url = str_replace( '/blog/author/', '/author/', $url );
$url = str_replace( '/blog/categorie/', '/categorie/', $url );
return $url;
}
@webfocusdesign
webfocusdesign / MSLS Menu Link Placement - functions.php
Created August 17, 2015 18:22
How to place the language menu link(s) in a menu, both when in regular localtion and by calling meny by name (when menu in widget for example).
@webfocusdesign
webfocusdesign / functions.php
Created November 16, 2018 02:56
WC Vendors - Redirect Vendors to Vendor Dashboard on Login
/* Redirect Vendors to Vendor Dashboard on Login */
add_filter('woocommerce_login_redirect', 'login_redirect', 10, 2);
function login_redirect( $redirect_to, $user ) {
// WCV dashboard -- Uncomment the 3 lines below if using WC Vendors Free instead of WC Vendors Pro
// if (class_exists('WCV_Vendors') && WCV_Vendors::is_vendor( $user->id ) ) {
// $redirect_to = get_permalink(WC_Vendors::$pv_options->get_option( 'vendor_dashboard_page' ));
// }
// WCV Pro Dashboard
@webfocusdesign
webfocusdesign / functions.php
Created November 16, 2018 02:58
Genesis - Featured Videos for Single Entries
//* Featured Videos for Single Entries
add_action( 'genesis_entry_header', 'featured_video_plus_single_page_override', 15 );
function featured_video_plus_single_page_override( $output ){
$image_args = array(
'size' => 'medium',
'attr' => array(
'class' => 'alignright featured-image',
),
);