Skip to content

Instantly share code, notes, and snippets.

View karki-dennis's full-sized avatar
🎯
Focusing

Dennish Karki karki-dennis

🎯
Focusing
View GitHub Profile
@karki-dennis
karki-dennis / centerimage.css
Created October 30, 2015 06:25
Center image horizontally
.banner-img{
display: block;
margin-left: auto;
margin-right: auto
}
@karki-dennis
karki-dennis / queryPostAndDisplayItsTerm
Created November 16, 2015 08:45
Query post to display its term also
<?php
$args = array(
'post_type' => 'post',
);
$query = new WP_Query($args);
while ($query->have_posts()) : $query->the_post();
?>
<div class="news-alert">
<?php $term= wp_get_post_terms($post->ID, 'category', array("fields" => "all"));
print_r($term);?>
jQuery.extend(jQuery.easing, {
easeOutQuint: function(x, t, b, c, d) {
return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
}
});
var wheel = false,
$docH = $(document).height() - $(window).height(),
$scrollTop = $(window).scrollTop();
Versatile and lightweight code with the aptitude of the JavaScript requestAnimationFrame feature and assistance of two well suited and proven jQuery plugins. Response to mousewheel turns is normalised by mousewheel.js which will provide a consistent and predictable amount of scrolling movement across browsers. Special types of animation easing provided by the easing.js script can create an elegant scroll curve and deceleration. The method's characteristic variables can be easily modified, offering the opportunity for customisation in great detail. Responsive capabilities are included and with the native jQuery animate method as an automatic fallback, legacy browser support is also available.
@karki-dennis
karki-dennis / input.css
Created November 26, 2015 08:19
input file button customize
.custom-file-input::-webkit-file-upload-button {
visibility: hidden;
}
.custom-file-input::before {
content: 'Browse';
display: inline-block;
background: #b29db5;
border-radius:0 5px 5px 0;
padding: 5px;
outline: none;
@karki-dennis
karki-dennis / register-featured-image.php
Created April 20, 2016 06:37
Add featured image field in wordpress theme
@karki-dennis
karki-dennis / Vertical Center
Created April 25, 2016 16:49
Vertical center with css
/*All browser support*/
.vertical-center{
width:250px;
top: 50%;
transform: translateY(-50%);
position: relative;
}
//Deregister Gravity Stylesheets and Scripts from specific pages
add_action("gform_enqueue_scripts", "deregister_scripts");
function deregister_scripts(){
//Change this conditional to target whatever page or form you need.
if(is_front_page()) {
@karki-dennis
karki-dennis / load flexslider inside fancybox .js
Created May 4, 2016 04:47
Load flexslider inside fancybox
$(".fancybox").fancybox({
autoSize: false, // keep this and let the slider to resize itself
afterLoad: function () {
$('.overlay-slider').flexslider({
animation: "slide",
controlNav: false,
start: function () {
$("#overlay").show() // make parent container visible
}
@karki-dennis
karki-dennis / month-year
Created May 5, 2016 02:58
Ui date picker month and year only
<input type="text" class="only-month-year">
<script type="text/javascript">
jQuery(function ($) {
jQuery(document).ready(function ($) {
$(".only-month-year .datepicker").datepicker({
dateFormat: 'MM yy',
changeMonth: true,
changeYear: true,
showButtonPanel: true,