Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧
Working from home

David Chandra Purnama turtlepod

🎧
Working from home
View GitHub Profile
@turtlepod
turtlepod / functions.php
Created Oct 10, 2017
listify_custom_autolocation *better
View functions.php
<?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 / wpjmcl_email_message_new_claim_admin
Created Sep 25, 2017
WPJM Claim Listing Notification Defaults
View wpjmcl_email_message_new_claim_admin
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
Created Sep 12, 2017
Use 3 Column Listing in Widgetize Page Template
View functions.php
<?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 / functions.php
Created Sep 12, 2017
Disable Listify 2.3.0 Popup
View functions.php
<?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
Created Sep 12, 2017
Remove Rating Display if No Rating Exists Yet in Listify Theme.
View functions.php
<?php
/**
* Remove Rating Display if No Rating Exists Yet
*
* @link https://secure.helpscout.net/conversation/425117562/121662/
*/
add_action( 'init', function() {
// Remove Rating in Card if Empty.
@turtlepod
turtlepod / stuff.php
Created Aug 24, 2017
Google Maps API Key Test
View stuff.php
<?php
/**
* Google API tester.
*/
function my_gmaps_key_test( $key ) {
$url = add_query_arg( $args = array(
'address' => 'Genbu Media',
), 'https://maps.googleapis.com/maps/api/geocode/json' );
@turtlepod
turtlepod / functions.php
Last active Aug 24, 2017 — forked from spencerfinnell/functions.php
Add a button to the main single hero actions in Listify. Add 'button-secondary' class to change the color to the accent color.
View functions.php
<?php
/**
* Plugin Name: Listify - Custom Single Listing Hero Button
*/
function custom_listify_single_job_listing_actions_after() {
global $post;
// Get URL.
$url = get_post_meta( $post->ID, 'your_custom_meta_key', true );
@turtlepod
turtlepod / functions.php
Created Aug 23, 2017
Listify: Display All Category (not nested) in single listing page
View functions.php
<?php
// Remove Category:
remove_action( 'single_job_listing_meta_start', 'listify_the_listing_category', 30 );
// Use Custom Category:
add_action( 'single_job_listing_meta_start', function() {
$cats = get_the_term_list(
get_post()->ID,
'job_listing_category',
'<span>',
@turtlepod
turtlepod / functions.php
Created Aug 23, 2017
Change Listify Map Marker Popup to Company Logo
View functions.php
<?php
// Change the data of a listing to add logo.
add_filter( 'listify_get_listing_to_array', function( $data, $listing ) {
$data['myLogoURL'] = esc_url( $listing->get_company_logo() );
return $data;
}, 10, 2 );
@turtlepod
turtlepod / listing-labels.min.js
Created Aug 9, 2017
Listing Labels JS without History JS
View listing-labels.min.js
/**
* Filter by labels.
*
* @since 2.0.0
*/
(function( window, undefined ) {
window.wp = window.wp || {};
var document = window.document;