Skip to content

Instantly share code, notes, and snippets.

function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
# Enable Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
<?php
$sdtime = DateTime::createFromFormat("d F, Y", '1 February, 2018');
$edtime = DateTime::createFromFormat("d F, Y", '30 February, 2018');
$startday = $sdtime->getTimestamp();
$endday = $edtime->getTimestamp();
$q = new WP_Query(
array(
This way does it with links intact. That is www.oldsite.com/some/crazy/link.html will become www.newsite.com/some/crazy/link.html. This is extremely helpful when you are just “moving” a site to a new domain. Place this on the OLD site:
Redirect 301 / http://newsite.com/
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/
<?php
function limit_words($string, $word_limit) {
$words = explode(' ', $string);
return implode(' ', array_slice($words, 0, $word_limit));
}
Uages
@mjinayan80
mjinayan80 / jquery-easing-js-code
Created April 2, 2018 11:32
jquery-easing-js code
//jquery-easing-js
$('.smooth-menu a').bind('click', function(event){
var $anchor = $(this);
var headerH = '30';
$('html, body').stop().animate({
scrollTop : $($anchor.attr('href')).offset().top - headerH +"px" }, 1200, 'easeInOutExpo');
event.preventDefault();
});
// Sticky Header
$(window).scroll(function() {
if ($(window).scrollTop() > 100) {
$('.main_h').addClass('sticky');
} else {
$('.main_h').removeClass('sticky');
}
});
@mjinayan80
mjinayan80 / back to top-html,css,js
Created March 28, 2018 11:41
back to top-html,css,js
html code
<div class="footer-area">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="footer-Up">
<a href="#" class="scrollToTop">
<span class="glyphicon glyphicon-menu-up"></span>
</a>
@mjinayan80
mjinayan80 / isotope html button group
Created March 20, 2018 11:06
isotope html button with active is chaked
<div class="button-group filter-button-group">
<button>Featured Projects-</button>
<button class="button is-checked" data-filter="*">show all</button>
<button class="button" data-filter=".cat-1">Web site</button>
<button class="button" data-filter=".cat-2">Print</button>
<button class="button" data-filter=".cat-3">Mobile</button>
<button class="button" data-filter=".cat-4">Photography</button>
<button class="button" data-filter=".cat-5">Illustration</button>
<button class="button" data-filter=".cat-6">Logo Design</button>
</div>