Skip to content

Instantly share code, notes, and snippets.

View anandkumar's full-sized avatar

Anand Kumar anandkumar

View GitHub Profile
@anandkumar
anandkumar / jss-script.js
Created April 26, 2014 12:06
Add 100px offset to jQuery smooth scroll Plugin
/* Smooth Back to Top, Get This functionality from: http://wordpress.org/extend/plugins/cudazi-scroll-to-top/ */
jQuery.noConflict();
jQuery(function($) {
// When to show the scroll link
// higher number = scroll link appears further down the page
var upperLimit = 100;
// Our scroll link element
@anandkumar
anandkumar / functions.php
Last active January 14, 2020 21:11
bbPress: Reverse forum replies order from newer to older
// Reverse forum replies order from newer to older
function custom_bbp_has_replies() {
$args['order'] = 'DESC'; // ‘ASC’ (Ascending, Default), 'DESC' (Descending)
return $args;
}
add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );
@anandkumar
anandkumar / How to Use Subversion.md
Last active August 19, 2018 14:43
How to Use Subversion

How to Use Subversion

This article is pulled from old WordPress tutorial archive using good ol' archive.org

We’ll describe here some of the basics about using subversion: starting out, changing things, and tagging releases. For more comprehensive documentation, see The SVN Book.

First, some terminology

If you're new to subversion, you'll need to know what a few words mean, so let's go over how subversion behaves to introduce some terms.

All your files will be centrally stored in the repository on our servers. From that repository, anyone can check out a copy of your plugin files onto their local machine, but, as a plugin author, only you have tho authority to check in. That means you can make changes to the files, add new files, and delete files on your local machine and upload those changes back to the central server. It's this process of checking in that updates both the files in the repository an

@anandkumar
anandkumar / inscript_in_devanagari.kbd
Created October 27, 2017 07:50
Klavaro Typing Tutor - Inscript (Devanagari)
ॊ१२३४५६७८९०-ृ\
ौैाीूबहगदजड़ॉ
ोे्िुपरकतचट
ॆंमनवलस,.य
ऒऍॅ#$%^&*()ःऋ|
औऐआईऊभङघधझ{}ऑ
ओएअइउफऱखथछठ
ऎँणऩऴळशष।य़
@anandkumar
anandkumar / functions.php
Created October 8, 2014 17:54
bbPress: Remove stupid 14px avatar and resize other.
<?php
//* Do NOT include the opening php tag
//* Notice the line 7, 8, 10 and 11
function my_bbp_change_avatar_size($author_avatar, $topic_id, $size) {
$author_avatar = '';
if ($size == 14) {
return $author_avatar;
}
@anandkumar
anandkumar / GTM on Genesis Framework
Created October 10, 2012 05:33
Google Tag Manager on Genesis
/**
* Add Add Google Tag Manager script on Genesis Framework
*
* @author Anand Kumar
* @link http://www.blogsynthesis.com/add-google-tag-manager-to-wordpress/#genesis-framework
*
*/
add_action('genesis_before', 'google_tag_manager');
function google_tag_manager() { ?>
@anandkumar
anandkumar / keybase.md
Last active May 1, 2016 15:06
keybase.md

Keybase proof

I hereby claim:

  • I am anandkumar on github.
  • I am anandkumar (https://keybase.io/anandkumar) on keybase.
  • I have a public key whose fingerprint is CE6B 3A32 84A5 2010 140B FE5A A16A F31B 2C10 97B8

To claim this, I am signing this object:

<?php
/**
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*/
@anandkumar
anandkumar / functions.php
Created December 24, 2013 16:04
bbPress limit content visibility for non-logged in user
// Display Topic Leads
add_filter('bbp_show_lead_topic', 'custom_bbp_show_lead_topic' );
function custom_bbp_show_lead_topic( $show_lead ) {
if ( !is_user_logged_in() ){
$show_lead[] = 'true';
return $show_lead;
}}
// Show Topic Leads to Public or Anonymous visitors
add_filter('bbp_has_replies', 'synth_logged_in_topics');
@anandkumar
anandkumar / functions.php
Created November 11, 2013 17:28
Remove WordPress Admin bar
// Remove WordPress Admin bar
add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}