Skip to content

Instantly share code, notes, and snippets.

View JasvinderSingh1's full-sized avatar
🤘

Jasvinder Singh JasvinderSingh1

🤘
  • Lucknow, India
View GitHub Profile
/**
* To make archive listing yearly instead of monthly
*/
function my_limit_archives( $args ) {
$args['type'] = 'yearly';
return $args;
}
add_filter( 'widget_archives_args', 'my_limit_archives' );
add_filter( 'widget_archives_dropdown_args', 'my_limit_archives' );
@JasvinderSingh1
JasvinderSingh1 / WordPress Plugins
Last active July 11, 2018 08:16
WordPress Useful Plugins
https://wordpress.org/plugins/nav-menu-roles/ Nav Menu Roles By Kathy Darling
https://wordpress.org/plugins/woocommerce-products-filter/ For product filter
//compare a date with current date
$end_date = 2018-06-24
if((time()-(60*60*24)) < strtotime($end_date))
//simple curl
$ch = curl_init();
$curlConfig = array(
CURLOPT_URL => "http://www.example.com/yourscript.php",
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
<script>
jQuery(document).ready(function(){
jQuery(document).on("click",".openpopup",function(){
jQuery(".popmain").show();
});
jQuery(document).on("click",".closepopup",function(){
jQuery(".popmain").hide();
});
});
@JasvinderSingh1
JasvinderSingh1 / CodeIgniter
Last active September 25, 2020 13:09
CodeIgniter Tips & Tricks
// .htaccess in codeigniter to remove index.php
Replace the below code in config.php file.
$config['index_page'] = "index.php"
// Remove index.php
$config['index_page'] = ""
create .htaccess file.
@JasvinderSingh1
JasvinderSingh1 / wordpress.txt
Last active February 21, 2021 18:37
WORDPRESS CODES
// reference for Wordpress Functions
https://codex.wordpress.org/Function_Reference
https://developer.wordpress.org/
/***********************/
Display terms with pagination start
if ( get_query_var( 'paged' ) )
$paged = get_query_var('paged');