Skip to content

Instantly share code, notes, and snippets.

@JoeHana
JoeHana / style.css.php
Created May 2, 2017 11:01
On-the-fly CSS Compression
<?php
/**
* On-the-fly CSS Compression
* Copyright (c) 2009 and onwards, Manas Tungare.
* Creative Commons Attribution, Share-Alike.
*
* In order to minimize the number and size of HTTP requests for CSS content,
* this script combines multiple CSS files into a single file and compresses
* it on-the-fly.
@JoeHana
JoeHana / functions.php
Created April 5, 2017 02:39
Modify Measurements
<?php
/**
* Modify Measurements
*/
add_filter( 'wpsight_measurements', 'custom_measurements' );
function custom_measurements ( $measurements ) {
$measurements = array(
@JoeHana
JoeHana / functions.php
Created April 5, 2017 02:21
Show advanced search fields by default
<?php
/**
* Show advanced search fields by default
*/
add_filter( 'wpsight_get_advanced_search_fields', 'custom_get_advanced_search_fields', 11 );
function custom_get_advanced_search_fields( $fields ) {
$fields_advanced['min']['advanced'] = false;
@JoeHana
JoeHana / functions.php
Last active December 5, 2018 03:40
Re-order fields in search form
<?php
/**
* Re-order fields in search form
*/
add_filter( 'wpsight_get_search_fields', 'custom_get_search_fields' );
function custom_get_search_fields( $fields ) {
$fields['offer']['priority'] = 10;
@JoeHana
JoeHana / functions.php
Created March 11, 2017 01:34
Remove Features from Search Form
<?php
/**
* Remove Features from Search Form
*/
add_filter( 'wpsight_get_advanced_search_fields', 'custom_get_advanced_search_fields', 10 );
function custom_get_advanced_search_fields( $fields ) {
@JoeHana
JoeHana / functions.php
Last active February 24, 2017 04:04
Change Archive Title
<?php
/**
* Change Archive Title
*/
add_filter( 'wpsight_get_archive_title', 'custom_get_archive_title', 100 );
function custom_get_archive_title() {
@JoeHana
JoeHana / functions.php
Created February 23, 2017 10:10
Change Labels of Listing Post Type
<?php
/**
* Change Labels of Listing Post Type
*/
add_filter( 'wpsight_post_type_labels_listing', 'custom_post_type_labels_listing' );
function custom_post_type_labels_listing( $labels ) {
@JoeHana
JoeHana / functions.php
Last active February 1, 2017 20:30
Add up to 20 bedrooms/bathrooms to listing details
<?php
/**
* Add up to 20 bedrooms/bathrooms to listing details
*/
add_filter( 'wpsight_details', 'custom_details' );
function custom_details( $details ) {
@JoeHana
JoeHana / functions.php
Created December 22, 2016 23:30
Custom Listing Category Taxonomy Slug
<?php
/**
* Custom Listing Category Taxonomy Slug
*/
add_filter( 'wpsight_rewrite_categories_slug', 'custom_rewrite_categories_slug', 11 );
function custom_rewrite_categories_slug( $slug ) {
return 'listing-category';
}
@JoeHana
JoeHana / functions.php
Created December 22, 2016 23:30
Custom Listing Feature Taxonomy Slug
<?php
/**
* Custom Listing Feature Taxonomy Slug
*/
add_filter( 'wpsight_rewrite_features_slug', 'custom_rewrite_features_slug', 11 );
function custom_rewrite_features_slug( $slug ) {
return 'feature';
}