This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! function_exists( 'listify_partial_site_branding' ) ) { | |
/** | |
* Site branding. | |
* | |
* @since 1.7.0 | |
* | |
* @return string | |
*/ | |
function listify_partial_site_branding() { | |
$custom_logo = get_theme_mod( 'custom_logo', null ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Attach custom data to the listing object. | |
* | |
* This does not output anything, it only passes the information to the Javascript template. | |
*/ | |
add_filter( 'listify_get_listing_to_array', function( $data, $listing ) { | |
// Get our custom value (this is the labels from the WP_Post object). Update accordingly. | |
$labels = get_the_term_list( $listing->get_object()->ID, 'job_listing_tag', '', ', ', '' ); | |
// Only add if our custom field is not empty. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'listify_map_settings', function( $args ) { | |
$args['mapService']['googlemaps']['autoCompleteArgs']['componentRestrictions'] = array( | |
'country' => ["uk"] | |
); | |
return $args; | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_listify_single_job_listing_actions_after() { | |
global $post; | |
$url = get_post_meta( $post->ID, '_company_website', true ); | |
echo '<a href="' . esc_url( $url ) . '" class="button">My Button</a>'; | |
} | |
add_filter( 'listify_single_job_listing_actions_after', 'custom_listify_single_job_listing_actions_after' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_user_contact_methods( $user_contact ) { | |
unset( $user_contact[ 'pintrest' ] ); | |
unset( $user_contact[ 'github' ] ); | |
unset( $user_contact[ 'googleplus' ] ); | |
unset( $user_contact[ 'linkedin' ] ); | |
return $user_contact; | |
} | |
add_filter( 'user_contactmethods', 'custom_user_contact_methods', 20 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'single_job_listing_start' , 'hide_claim_widget', 150, 3 ); | |
function hide_claim_widget( ) { | |
$claimed = get_post_meta( get_post()->ID, '_claimed', true ); | |
if ( 1 == $claimed ) { | |
echo '<style>.widget_listing_sidebar_claim_listing{display:none;}</style>'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hide_cart( $items){ | |
if (!is_user_logged_in()){ | |
$items = ' '; | |
} | |
return $items; | |
} | |
add_filter( 'listify_cart_icon_logged_in_only', 'hide_cart'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function trim_excerpt($text) { | |
$string = "...."; | |
$text = $text . $string; | |
return $text; | |
} | |
add_filter('get_the_excerpt', 'trim_excerpt', 99); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'post_type' => 'job_listing', | |
'orderby' => array( 'menu_order' => 'ASC', 'date' => 'DESC' ), | |
'order' => 'asc', | |
'post_status' => 'publish' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_address_formats( $formats ) { | |
$formats[ 'DK' ] = "{address_1} {street_number} \n{address_2}\n{postcode} {city} {state}\n{country}"; | |
return $formats; | |
} | |
add_filter( 'listify_address_formats', 'custom_address_formats', 20 ); |