Skip to content

Instantly share code, notes, and snippets.

View yousufansa's full-sized avatar

Yusuf Ansari yousufansa

View GitHub Profile
@yousufansa
yousufansa / functions.php
Created October 19, 2018 12:24
Jobhunt - Post A Job url change
add_filter('jobhunt_header_post_a_job_button_url', 'jobhunt_child_header_post_a_job_button_url');
if ( !function_exists('jobhunt_child_header_post_a_job_button_url') ) {
function jobhunt_child_header_post_a_job_button_url( $page_url ) {
return 'your_url_here';
}
}
@yousufansa
yousufansa / functions.php
Created October 20, 2018 07:38
Jobhunt - Job Region Dropdown in Job Search
if ( class_exists( 'WP_Job_Manager' ) && class_exists( 'Astoundify_Job_Manager_Regions' ) ) {
if ( ! function_exists( 'jobhunt_job_header_search_block' ) ) {
/**
* Display Job Header Search block
*/
function jobhunt_job_header_search_block( $args = array() ) {
$defaults = apply_filters( 'jobhunt_job_header_search_block_args', array(
'section_title' => esc_html__( 'Explore Thousand Of Jobs With Just Simple Search...', 'jobhunt' ),
'sub_title' => '',
@yousufansa
yousufansa / functions.php
Created October 20, 2018 12:52
Jobhunt - Job Single Sidebar Custom Content
add_action( 'single_job_listing_sidebar', 'jh_child_display_job_details_sidebar_custom_content', 40 );
if ( ! function_exists( 'jh_child_display_job_details_sidebar_custom_content' ) ) {
function jh_child_display_job_details_sidebar_custom_content() {
?><div class="sidebar-aditional-content">
Your Content
</div><?php
}
}
@yousufansa
yousufansa / functions.php
Created October 20, 2018 14:38
Jobhunt - Display Job Category & Job Region in Jobs Listing
add_action( 'jobhunt_job_listing_title', 'jobhunt_template_job_listing_category', 65 );
add_action( 'jobhunt_job_listing_title', 'jobhunt_template_job_listing_region', 65 );
if ( ! function_exists( 'jobhunt_template_job_listing_region' ) ) {
function jobhunt_template_job_listing_region() {
global $post;
$post = get_post( $post );
echo '<div class="job-listing-region-custom">' . jobhunt_get_wpjm_taxomony_data( $post, 'job_listing_region', false ) . '</div>';
?><style>
@yousufansa
yousufansa / functions.php
Created October 22, 2018 10:58
Jobhunt - Display Job Description Excerpt In Job Listings
if ( ! function_exists( 'jobhunt_template_job_listing_desc_excerpt' ) ) {
function jobhunt_template_job_listing_desc_excerpt() {
global $post;
$post = get_post( $post );
$excerpt_length = '20';
echo '<p class="job_listing-desc-excert">' . wp_kses_post( wp_trim_words( $post->post_content , $excerpt_length , '...' ) ) . '</p>' ;
}
}
@yousufansa
yousufansa / functions.php
Created October 24, 2018 06:50
Jobhunt - Post A Job Team Size Select Placeholder Text
if ( ! function_exists( 'jh_child_submit_job_form_company_fields_team_size_placeholder_text_edit' ) ) {
function jh_child_submit_job_form_company_fields_team_size_placeholder_text_edit( $fields ) {
$fields['company_team_size']['placeholder'] = esc_html__( 'Your Text', 'jobhunt-child' );
return $fields;
}
}
add_filter( 'jobhunt_submit_job_form_company_fields', 'jh_child_submit_job_form_company_fields_team_size_placeholder_text_edit' );
@yousufansa
yousufansa / functions.php
Created October 24, 2018 13:31
Jobhunt - Home v1 Custom Page Header with Register/Login Form
if ( ! function_exists( 'jh_child_home_v1_page_header_custom' ) ) {
function jh_child_home_v1_page_header_custom() {
$section_class = 'site-content-page-header';
?><header class="<?php echo esc_attr( $section_class ); ?>" <?php echo jobhunt_site_content_bg_image(); ?>>
<div class="site-content-page-header-inner">
<?php
do_action( 'jobhunt_home_page_header_before' );
?>
<div class="site-content-page-header-custom">
@yousufansa
yousufansa / functions.php
Created October 25, 2018 06:53
Jobhunt - Job Dashboard Remove Duplicate & Mark Filled
if ( ! function_exists( 'jh_child_remove_job_manager_my_job_actions' ) ) {
function jh_child_remove_job_manager_my_job_actions( $actions ) {
unset ( $actions['mark_filled'] );
unset ( $actions['mark_not_filled'] );
unset ( $actions['duplicate'] );
return $actions;
}
}
add_filter( 'job_manager_my_job_actions', 'jh_child_remove_job_manager_my_job_actions' );
@yousufansa
yousufansa / functions.php
Created October 25, 2018 11:46
Jobhunt - WooCommerce Account Remove Display Name Field
if ( ! function_exists( 'jh_child_change_woocommerce_save_account_details_required_fields' ) ) {
function jh_child_change_woocommerce_save_account_details_required_fields( $required_fields ) {
unset ( $required_fields['account_display_name'] );
return $required_fields;
}
}
add_filter( 'woocommerce_save_account_details_required_fields', 'jh_child_change_woocommerce_save_account_details_required_fields' );
@yousufansa
yousufansa / functions.php
Created October 29, 2018 06:37
Jobhunt - Display Parent Job Categories Block Only
if ( ! function_exists( 'jh_child_change_job_categories_block_args' ) ) {
function jh_child_change_job_categories_block_args( $args ) {
$args['category_args']['parent'] = 0;
return $args;
}
}
add_filter( 'jobhunt_home_v1_job_categories_block_args', 'jh_child_change_job_categories_block_args' );