Skip to content

Instantly share code, notes, and snippets.

@JoeHana
JoeHana / functions.php
Created December 22, 2016 23:29
Custom Listing Type Taxonomy Slug
<?php
/**
* Custom Listing Type Taxonomy Slug
*/
add_filter( 'wpsight_rewrite_types_slug', 'custom_rewrite_types_slug', 11 );
function custom_rewrite_types_slug( $slug ) {
return 'type';
}
@JoeHana
JoeHana / functions.php
Created December 22, 2016 23:29
Custom Listing Locations Taxonomy Slug
<?php
/**
* Custom Listing Locations Taxonomy Slug
*/
add_filter( 'wpsight_rewrite_loctions_slug', 'custom_rewrite_loctions_slug', 11 );
function custom_rewrite_loctions_slug( $slug ) {
return 'location';
}
@JoeHana
JoeHana / functions.php
Created December 22, 2016 23:29
Custom Listing Post Type Slug
<?php
/**
* Custom Listing Post Type Slug
*/
add_filter( 'wpsight_rewrite_listings_slug', 'custom_rewrite_listings_slug', 11 );
function custom_rewrite_listings_slug( $slug ) {
return 'listing';
}
@JoeHana
JoeHana / functions.php
Created December 22, 2016 23:27
Make Listing Type Taxonomy hierarchical
<?php
/**
* Make Listing Type Taxonomy hierarchical
*/
add_filter( 'wpsight_taxonomy_types_args', 'custom_taxonomy_types_args' );
function custom_taxonomy_types_args( $args ) {
$args['hierarchical'] = true;
@JoeHana
JoeHana / functions.php
Created November 17, 2016 01:55
WPCasa: Reset Demo Content Import DB
/**
* If the Demo Content Import fails, the following code can be placed to any PHP File
* which gets loaded (eg. functions.php), saved, page reloaded and removed.
* It will delete the entry in the DB to reset the Demo Content Importer to be able to re-try it.
*/
delete_option( 'wpsight_demo_import_step_content' );
delete_option( 'wpsight_demo_import_step_theme-options' );
delete_option( 'wpsight_demo_import_step_widgets-content' );
delete_option( 'wpsight_demo_import_step_custom-options' );
@JoeHana
JoeHana / functions.php
Last active November 8, 2017 02:14
Custom Advanced Search Fields
<?php
/**
* Custom Advanced Search Fields
*/
add_filter( 'wpsight_get_advanced_search_fields', 'custom_get_advanced_search_fields', 11 );
function custom_get_advanced_search_fields( $fields ) {
@JoeHana
JoeHana / functions.php
Created October 4, 2016 22:39
Define custom image sizes for Sylt Theme
<?php
/**
* Define custom image sizes for Sylt Theme
*/
add_filter( 'wpsight_madrid_image_sizes', 'custom_madrid_image_sizes' );
function custom_madrid_image_sizes( $image_sizes ) {
@JoeHana
JoeHana / functions.php
Created August 30, 2016 15:16
Custom Listing Details
/**
* Custom Listing Details
*/
add_filter( 'wpsight_details', 'custom_details' );
function custom_details( $details ) {
$details['details_1']['data'] = array(
'' => __( 'n/d', 'wpcasa' ),
'10' => '1',
@JoeHana
JoeHana / functions.php
Created August 9, 2016 02:03
Customize "Offer" Label in Search Form
/**
* Customize "Offer" Label in Search Form
*/
add_filter( 'wpsight_get_search_fields', 'custom_get_search_fields' );
function custom_get_search_fields( $fields ) {
$fields['offer']['label'] = __( 'Custom Label', 'wpcasa' );
return $fields;
@JoeHana
JoeHana / functions.php
Last active January 9, 2019 16:07
Add custom text (from) before price
/**
* Add custom text (from) before price
*/
add_filter( 'wpsight_get_listing_price_before', 'custom_get_listing_price_before' );
function custom_get_listing_price_before( $value ) {
if( wpsight_get_listing_price_raw() )
$value .= '<small>' . __('from', 'wpcasa' ) . '</small> ';