Skip to content

Instantly share code, notes, and snippets.

View psahalot's full-sized avatar

Puneet Sahalot psahalot

View GitHub Profile
<?php
/*
This file is for skin specific customizations. Be careful not to change your skin's skin.php file as that will be upgraded in the future and your work will be lost.
If you are more comfortable with PHP, we recommend using the super powerful Thesis Box system to create elements that you can interact with in the Thesis HTML Editor.
*/
add_action("gform_post_submission", "set_post_content", 10, 2);
function set_post_content($entry, $form)
{
@psahalot
psahalot / Gzip
Created August 5, 2014 19:42
Gzip for IB post
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
@psahalot
psahalot / Hide out of stock - Category Archive
Last active August 29, 2015 14:25
Hide out of stock products from category archives in WooCommerce
<?php
// Do not include the opening tag
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' );
function custom_pre_get_posts_query( $q ) {
if ( ! $q->is_main_query() ) return;
if ( ! $q->is_post_type_archive() ) return;
if ( ! is_admin() ) {
@psahalot
psahalot / functions.php
Created April 23, 2012 22:24
Editing WordPress profiles with Gravity Forms
<?php
// add the following to your functions file or similar
define( 'FUBLO_GF_PROFILE', 1 ); // define the ID number of your profile form.
// ============================================================= PROFILE EDITING
/**
* These are the user metadata fields, with their names and the data about them.
@psahalot
psahalot / Advanced WP Plugins
Created September 11, 2012 13:45
List of useful WP Plugins
http://interconnectit.com/products/the-auditor/
http://infinitewp.com/addons/
@psahalot
psahalot / WP Devs
Created September 11, 2012 13:44
A list of WP Developers and Agencies
http://hmn.md/
http://interconnectit.com
http://jamesdalman.com
@psahalot
psahalot / Responsive
Created September 11, 2012 21:38
Responsive web dev resources
http://bradfrost.github.com/this-is-responsive/
@psahalot
psahalot / ISS and WP
Created September 13, 2012 10:06
Rewrite rules for IIS
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
@psahalot
psahalot / Switch to Root user
Created September 24, 2012 00:58
Switch to Root user
sudo su
@psahalot
psahalot / Install Apache
Created September 24, 2012 01:05
Install Apache web server
apt-get install apache2