Skip to content

Instantly share code, notes, and snippets.

View dasbairagya's full-sized avatar
🎯
Focusing

Gopal Dasbariagya dasbairagya

🎯
Focusing
View GitHub Profile
@VivekSaha
VivekSaha / nav-walker(header.php)
Last active May 30, 2018 04:01
nav-walker(header.php)
<?php
wp_nav_menu( array(
'menu' => 'main_menu',
'theme_location' => 'main_menu',
'depth' => 2,
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'bs-example-navbar-collapse-1',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
@dasbairagya
dasbairagya / search.php
Created April 9, 2018 10:16
WP Custom Search
<?php
/**
* Template Name: Search1
*/
get_header(); ?>
<form id="searchform" action="" method="get">
<input class="" type="text" name="serchprm" id="searchinput" placeholder="Search">
@dasbairagya
dasbairagya / index.php
Created April 28, 2017 11:57
Get the image,title and link of the parent term of product_cat taxonomy in woocommerce for creating the slide in home page with parent category.
<?php
$pterms = get_terms( array(
'taxonomy' => 'product_cat',
'parent' => 0
) );
// echo '<pre>';
// var_dump($terms);
foreach ($pterms as $myterm) {
$term_link = get_term_link( $myterm );
$thumbnail_id = get_woocommerce_term_meta($myterm->term_id, 'thumbnail_id', true);
@dasbairagya
dasbairagya / live-templates.php
Last active January 2, 2017 12:54
Phpstrom live templates
Abbreviation: cpt
Description: custom post type
<?php
/**
* Register Post Type $cpt$
*/
add_action( 'init', 'codex_$cpt$_init' );
function codex_$cpt$_init() {
@dasbairagya
dasbairagya / jQuery-autocomplete.php
Last active January 2, 2017 05:36
JQuery autocomplete input-field by term-taxonomy.
<?php
/**
* Template Name: Test
* Created by PhpStorm.
* User: PC35
* Date: 23-12-2016
* Time: 10:32
*/
?>