Skip to content

Instantly share code, notes, and snippets.

<script>
(function($){
$(document).on('click', 'button.close', function(e){
e.preventDefault();
window.location.hash = '';
});
$(window).on('hashchange', function(){
$('#update_passport, #uploader, #register, #login, #challenge_login, #challenge_uploader').removeClass('active');
@nikolab
nikolab / Get person content - Ajax
Created December 18, 2019 21:31
Get person content - Ajax
//team showcase
$(document).unbind("click").on("click", ".tshowcase-box", function (event) {
$this = $(this);
$this.siblings().removeClass('active');
$('.person-content-wrap').hide();
$this.toggleClass('active');
var url = $(this).find('a').attr('href'); //get url
var new_url = url.substring(0, url.indexOf(' ')); //substirng url
//get person content
@nikolab
nikolab / Remove generator version number
Created February 13, 2018 21:51
Remove version string from js and css
<?php
/*
Remove generator version number
@package premiumtheme
*/
/**
@nikolab
nikolab / Ping
Created February 13, 2018 21:35
Ping for seo in header
<?php if( is_singular() && pings_open( get_queried_object() ) ): ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php endif; ?>
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
function my_theme_wrapper_start() {
echo '<div id="primary" class="content-area">';
echo '<main id="main" class="site-main" role="main">';
}
function my_theme_wrapper_end() {
@nikolab
nikolab / WooCommerce removes link to single product page
Last active December 21, 2016 15:48
Remove link (anchor tag) to single product page
@nikolab
nikolab / WooCommerce product variables on shop page
Created December 21, 2016 15:04
Adds product variables directly on shop page
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 30 );
@nikolab
nikolab / WooCommerce currency change for Serbian dinar
Last active December 21, 2016 15:00
Make your own currency
add_filter( 'woocommerce_currencies', 'add_my_currency' );
function add_my_currency( $currencies ) {
$currencies['RSD'] = __( 'Currency name', 'woocommerce' );
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
function add_my_currency_symbol( $currency_symbol, $currency ) {