This file contains hidden or 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
// Remove CSS from WooCommerce after version 2.1, see https://gist.github.com/Willem-Siebe/8c29bcfa791316165127. | |
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); |
This file contains hidden or 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
// Register multiple WordPress menu's, see https://gist.github.com/Willem-Siebe/40311753fce4bfb5fd62. | |
function wsis_register_nav_menus() { | |
register_nav_menus(array( | |
'support_navigation' => 'Support Navigation', | |
'shop_navigation' => 'Shop Navigation', | |
'social_navigation' => 'Social Navigation', | |
'footer_navigation' => 'Footer Navigation', | |
)); } |
This file contains hidden or 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
// Remove 'span12' class from main navigation, see https://gist.github.com/Willem-Siebe/02d97fd251a1967a8adc. | |
function wpbootstrap_get_nav_menu_classes() { | |
$wpbootstrap_navbar_classes = 'navbar'; | |
if ( of_get_option( 'navbar_style' ) === 'menu_static' ) { | |
$wpbootstrap_navbar_classes = $wpbootstrap_navbar_classes . ''; |
This file contains hidden or 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
// Overwrite Toolset Bootstrap parent theme widget arrays, see https://gist.github.com/Willem-Siebe/b8d8c048c979976b8d63. | |
function wpbootstrap_register_sidebar() { | |
register_sidebar(array( | |
'name' => __('Sidebar', 'wpbootstrap'), | |
'id' => 'sidebar', |
This file contains hidden or 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
// Register new sidebar, see https://gist.github.com/Willem-Siebe/212a11e40442c38f20a2. | |
function wsis_register_sidebar_footer_widgets_top() { | |
register_sidebar(array( | |
'name' => __('Footer widgets top', 'wpbootstrap'), | |
'id' => 'footer-widgets-top', |
This file contains hidden or 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
// Add Facebook Javascript to your website, see https://gist.github.com/Willem-Siebe/9f5580bbe26991e2619c. | |
function wsis_add_facebook_script() { | |
?> | |
<div id="fb-root"></div> | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.async=true; js.src = "//connect.facebook.net/nl_NL/sdk.js#xfbml=1&appId=xxxxxxxxxxxxxxxxxxxx&version=v2.0"; |
This file contains hidden or 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
// Toggling content using Twitter Bootstrap (V3) and jQuery, see https://gist.github.com/Willem-Siebe/d04636bb5eb42b28cdab. | |
jQuery(document).ready(function() { | |
jQuery(".wsis-toggle").click(function(){ | |
jQuery(".wsis-collapse").toggle().toggleClass( "hidden show" ); | |
}); | |
}); |
This file contains hidden or 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
// Adding Masonry Library to your WordPress (child) Theme, see https://gist.github.com/Willem-Siebe/58e22d515087f1bba7aa. | |
// WSIS: Only use 'if' if you implement it in a parent theme. | |
if (! function_exists('wsis_slug_scripts_masonry') ) { | |
function wsis_slug_scripts_masonry() { | |
// WSIS: Add conditional tags here to only load it on specific pages. | |
wp_enqueue_script('masonry'); | |
wp_enqueue_style('masonry-init', get_stylesheet_directory_uri().'/css/masonry.css'); | |
} |
This file contains hidden or 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
// Initialize Masonry Javascript, see https://gist.github.com/Willem-Siebe/e1096df4ad303b90ad1c. | |
function wsis_slug_masonry_init() { | |
if ( is_tax() || is_front_page() || is_search() ) { | |
?> | |
<script> | |
jQuery(document).ready(function($){ | |
var $container = $("#wsis-wc-product-loop"); | |
// initialize Masonry after all images have loaded | |
$container.imagesLoaded( function() { |
This file contains hidden or 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
// Display WooCommerce shop, category and tag description also on next pages, see https://gist.github.com/Willem-Siebe/c883eeb2eefb5eea82ab. | |
function woocommerce_product_archive_description() { | |
if ( is_post_type_archive( 'product' ) && get_query_var( 'paged' ) >= 0 ) { | |
$shop_page = get_post( wc_get_page_id( 'shop' ) ); | |
if ( $shop_page ) { | |
$description = apply_filters( 'the_content', $shop_page->post_content ); | |
if ( $description ) { | |
echo '<div class="page-description">' . $description . '</div>'; | |
} |