Skip to content

Instantly share code, notes, and snippets.

View dasbairagya's full-sized avatar
🎯
Focusing

Gopal Dasbariagya dasbairagya

🎯
Focusing
View GitHub Profile
@dasbairagya
dasbairagya / redme.txt
Created January 20, 2017 21:52
what is json?
JSON IS NOTHING BUT AN ARRAY OF OBJECTS.
OBJECT:
var myCar = {
"name": "Audi",
"model": "AU-300",
"color": "Red"
}
var myColor = {
@dasbairagya
dasbairagya / index.html
Last active January 20, 2017 22:11
JSON API WITH AJAX
<!DOCTYPE html>
<html>
<head>
<title>json and ajax</title>
<style type="text/css">
.hide-me{
display: none;
}
</style>
</head>
@dasbairagya
dasbairagya / paginate.php
Created January 22, 2017 16:41
paginate_links()
<?php $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => get_option('to_count_portfolio'), 'paged' => get_query_var('paged') ? get_query_var('paged') : 1 )
); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<span class="title"><?php the_title(); ?></span></br>
<?php endwhile; ?>
<?php
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
@dasbairagya
dasbairagya / car-search.php
Created January 22, 2017 17:23
seattleshuttlex-search page
<?php
/*
Template Name: Car Search
*/
error_reporting(0);
get_header('inner');
if($_POST['btn_submit']) {
$service = $_POST['select1'];
$zipcode = $_POST['select3'];
@dasbairagya
dasbairagya / functions.php
Created January 23, 2017 09:07
Login/Register for wordpress
<?php
/***After Successful login redirects**/
//function redirect_user_on_role()
//{
// global $current_user;
// get_currentuserinfo();
//
// //If login user role is Subscriber
// if ($current_user->user_level == 0)
// {
@dasbairagya
dasbairagya / custom.js
Last active February 6, 2017 18:05
Advance Login Register with modal popup
(function($){
"use strict";
/**
@dasbairagya
dasbairagya / footer.php
Created February 16, 2017 04:18
Simple news letter form of ultimate newsletter plugin
@dasbairagya
dasbairagya / index.php
Last active February 22, 2017 06:37
Show the related post for (grouped as same taxonomy and same cpt)
<?php // get the custom post type's taxonomy terms
$custom_taxterms = wp_get_object_terms( $post->ID, 'your_taxonomy', array('fields' => 'ids') );
// arguments
$args = array(
'post_type' => 'your_post_type',
'post_status' => 'publish',
'posts_per_page' => 3, // you may edit this number
'orderby' => 'rand',
'tax_query' => array(
@dasbairagya
dasbairagya / ajax-contact.php
Last active March 4, 2017 14:04
Display an Image Spinner During an Ajax Request
<?php
/*
*Template Name: Ajax
*/
?>
<html>
<head>
<!--http://www.itgeared.com/ -->
<!-- //loader image referance : http://www.ajaxload.info/ -->
@dasbairagya
dasbairagya / woocommerce.php
Last active May 17, 2017 12:08
Woocommerce product-details page common customization
<?php if (is_single()){ ?>
<style>
/*woocommerce customization*/
.product_meta {
float: left;
clear: both;
line-height: 50px;
}
button.single_add_to_cart_button.button.alt {
width: 35%;