Skip to content

Instantly share code, notes, and snippets.

Sridhar Katakam srikat

Block or report user

Report or block srikat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@srikat
srikat / Stylefile.yml
Last active Jul 31, 2018
Customizations for www.elected.com.au via StyleURL.
View Stylefile.yml
---
version: 1.0
domains:
- www.elected.com.au
url_patterns:
- www.elected.com.au/*
timestamp: '2018-07-31T23:44:01Z'
id: BKFt
redirect_url: http://www.elected.com.au/oxygen/lets-talk/
shared_via: StyleURL - (https://styleurl.app) import and export CSS changes from Chrome
@srikat
srikat / test.html
Created May 8, 2018
Dummy Content for Gutenberg
View test.html
<!-- wp:heading -->
<h2>Heading Block (H2)</h2>
<!-- /wp:heading -->
<!-- wp:heading -->
<h3>You are looking at one. (H3)</h3>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>Subhead Block</h2>
@srikat
srikat / keyboard-action-active-plugins.php
Last active Mar 15, 2018
Additional custom Actions for Keyboard Action to navigate to the list of active and inactive plugins
View keyboard-action-active-plugins.php
<?php
/**
* Plugin Name: Keyboard Action - Active Plugins
* Description: Additional custom Action for Keyboard Action to navigate to the list of active plugins
* Version: 0.1.0
* Author: Sridhar Katakam
* Author URI: https://sridharkatakam.com/
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
View functions.php
<?php
/**
* Genesis Sample.
*
* This file adds functions to the Genesis Sample Theme.
*
* @package Genesis Sample
* @author StudioPress
* @license GPL-2.0+
* @link http://www.studiopress.com/
@srikat
srikat / functions.php
Last active Oct 13, 2019
Remove "Select options" button from (variable) products on the main WooCommerce shop page. https://sridharkatakam.com/remove-select-options-button-variable-products-main-woocommerce-shop-page/
View functions.php
// Remove "Select options" button from (variable) products on the main WooCommerce shop page.
add_filter( 'woocommerce_loop_add_to_cart_link', function( $product ) {
global $product;
if ( is_shop() && 'variable' === $product->product_type ) {
return '';
} else {
sprintf( '<a href="%s" data-quantity="%s" class="%s" %s>%s</a>',
esc_url( $product->add_to_cart_url() ),
View functions.php
add_filter( 'genesis_seo_title', 'custom_header_inline_logo', 10, 3 );
/**
* Add an image inline in the site title element for the logo
*
* @param string $title Current markup of title.
* @param string $inside Markup inside the title.
* @param string $wrap Wrapping element for the title.
*
* @author @_AlphaBlossom
* @author @_neilgee
View functions.php
add_filter( 'manage_media_columns', 'sk_media_columns_filesize' );
/**
* Filter the Media list table columns to add a File Size column.
*
* @param array $posts_columns Existing array of columns displayed in the Media list table.
* @return array Amended array of columns to be displayed in the Media list table.
*/
function sk_media_columns_filesize( $posts_columns ) {
$posts_columns['filesize'] = __( 'File Size', 'my-theme-text-domain' );
@srikat
srikat / notes
Last active Apr 12, 2017
stylelint and ESLint for WordPress CSS & JavaScript Coding Standards
View notes
0) Install node via nvm
1) npm install -g eslint stylelint stylelint-config-wordpress eslint-config-wordpress
2) install SublimeLinter-contrib-stylelint ST package.
3) Create file named .stylelintrc in a locaton, say /Users/sridharkatakam/Documents/Websites having https://bbpress.trac.wordpress.org/browser/trunk/.stylelintrc
4) In SublimeLinter User Settings,
@srikat
srikat / functions.php
Last active Apr 16, 2019
Display Portfolio CPT's linked taxonomy terms (categories and tags) in Genesis entry meta. https://sridharkatakam.com/displaying-cpt-taxonomy-terms-genesis-entry-footer/
View functions.php
add_shortcode( 'portfolio_terms', 'custom_portfolio_terms_shortcode' );
/**
* Produces the linked post taxonomy terms list.
*
* Supported shortcode attributes are:
* after (output after link, default is empty string),
* before (output before link, default is 'Tagged With: '),
* sep (separator string between tags, default is ', '),
* taxonomy (name of the taxonomy, default is 'category').
*
@srikat
srikat / functions.php
Last active Oct 31, 2016
Horizontal Opt-in Form in Genesis using eNews Extended plugin and Flexbox. https://sridharkatakam.com/horizontal-opt-form-genesis-using-enews-extended-plugin-flexbox/
View functions.php
// Register Horizontal Opt-in widget area
genesis_register_widget_area(
array(
'id' => 'horizontal-opt-in',
'name' => __( 'Horizontal Opt-in', 'my-theme-text-domain' ),
'description' => __( 'This is the horizontal opt-in section.', 'my-theme-text-domain' ),
)
);
// Display Horizontal Opt-in widget area below header
You can’t perform that action at this time.