Skip to content

Instantly share code, notes, and snippets.

View turtlepod's full-sized avatar
🎧
Working from home

David Chandra Purnama turtlepod

🎧
Working from home
View GitHub Profile
@turtlepod
turtlepod / functions.php
Created September 12, 2017 07:32
Use 3 Column Listing in Widgetize Page Template
<?php
/**
* Use 3 Column Listing in Widgetize Page Template
*/
add_action( 'template_redirect', function() {
if ( is_page_template( 'page-templates/template-widgetized.php' ) ) {
add_filter( 'listify_get_card_listing_class_columns', function( $col ) {
return 'col-xs-12 col-md-6 col-lg-4';
});
@turtlepod
turtlepod / wpjmcl_email_message_new_claim_admin
Created September 25, 2017 03:30
WPJM Claim Listing Notification Defaults
Hi Admin,
New claim submitted, here's the details.
Listing URL: %listing_url%
Claimed by: %claimer_name%
Claim Status: %claim_status%
Edit Claim: %claim_edit_url%
Thank you.
@turtlepod
turtlepod / functions.php
Last active November 3, 2017 04:18
Listify: Remove Types Filter & Labels Filters
<?php
/**
* Remove Types Filter Fields
*
* @link https://gist.github.com/turtlepod/94a6dcf29a6405ca55977ea24b00422f
*/
add_action( 'init', function() {
// Remove the label.
remove_action( 'job_manager_job_filters_end', array( 'Listify_WP_Job_Manager_Template_Filters', 'job_types_label' ), 9 );
@turtlepod
turtlepod / functions.php
Created November 13, 2017 14:45
Listify Snippet: Remove Location Facets
<?php
// Filter registered facets.
add_filter( 'facetwp_facets', function( $facets ) {
/**
* Loop each facets.
* Listify facets are "keyword", "location", and "category"
*/
foreach ( $facets as $index => $facet ) {
@turtlepod
turtlepod / functions.php
Last active November 14, 2017 08:16
Listify Snippet: Change Location Field to Address
<?php
/**
* Change The Location Fields to "Address"
*
* @link https://gist.github.com/turtlepod/e05053729577fdbf2daa604bb32271b7
*/
add_action( 'init', function() {
@turtlepod
turtlepod / some.php
Created November 14, 2017 08:28
Listify FacetWP: Listings Template Query
<?php
return array(
'post_type' => 'job_listing',
'orderby' => array( 'menu_order' => 'ASC', 'date' => 'DESC' ),
'order' => 'asc',
'post_status' => 'publish'
);
@turtlepod
turtlepod / functions.php
Created September 12, 2017 06:30
Disable Listify 2.3.0 Popup
<?php
/**
* Disable Listify v.2.3.0 PopUp for WooCommerce My Account Page.
*/
add_action( 'init', function() {
remove_filter( 'listify_js_settings', array( $GLOBALS['listify_woocommerce'], 'add_myaccount_login_popup_trigger' ) );
} );
/**
@turtlepod
turtlepod / functions.php
Last active December 30, 2018 12:23
Listify Snippet: Add Listing Category in Listing Card
<?php
/**
* Add Category List To Listing Data.
*
* @link https://gist.github.com/turtlepod/0642d19439de6b96da06342619ed705a
*/
add_filter( 'listify_get_listing_to_array', function( $data, $listing ) {
@turtlepod
turtlepod / functions.php
Created October 10, 2017 13:20
listify_custom_autolocation *better
<?php
/**
* Auto Populate Location Field
*
* @link https://www.facebook.com/groups/1035604846471813/permalink/1656529524379339/
*/
function listify_custom_autolocation() {
if ( ! ( is_front_page() || listify_is_job_manager_archive() ) ) {
@turtlepod
turtlepod / functions.php
Last active August 18, 2019 11:01
Listify Snippet: Very Raw Idea (consider this as proof of concept) In How to Create Custom Locate Me Button To Get Only City Name.
<?php
add_action( 'wp_footer', function() {
?>
<script>
jQuery( document ).ready( function($) {
// Add custom locate me button.
$( '.search_location' ).append( '<i class="locate-me-too"></i>' );