Skip to content

Instantly share code, notes, and snippets.

View yousufansa's full-sized avatar

Yusuf Ansari yousufansa

View GitHub Profile
@yousufansa
yousufansa / style.css
Created January 14, 2019 07:06
Jobhunt - Post A Job Fields Multi Select Style Fix
.chosen-container-multi .chosen-choices .search-field {
width: 100%;
}
.chosen-container-multi .chosen-choices .search-choice + .search-field {
width: 60px;
}
@yousufansa
yousufansa / functions.php
Created January 14, 2019 07:45
Jobhunt - Job Header Search Hierarchical Dropdown
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' => '',
'search_placeholder_text' => esc_html__( 'Job title, keywords or company name', 'jobhunt' ),
@yousufansa
yousufansa / functions.php
Created January 14, 2019 16:29
Job Overview Custom Field Display Example
if( ! function_exists( 'jh_child_single_job_overview_details' ) ) {
function jh_child_single_job_overview_details( $args ) {
$args['job_salary'] = array( /* field name without prefix _ (underscore) - you can find the field name by inspecting that field in add new job on WP Admin Panel */
'icon' => 'la la-money', /* Replace "la la-money" with Your Icon Class. */
'label' => esc_html__( 'Job Salary', 'jobhunt' ), /* Replace "Job Salary" with Your Field Title. */
'callback' => 'jh_child_single_job_overview_job_salary', /* Add the field name with the prefix jh_child_single_job_overview */
);
return $args;
}
@yousufansa
yousufansa / functions.php
Created January 17, 2019 16:18
Jobhunt - Add Custom Register Form Fields
if( ! function_exists( 'jh_child_extra_register_fields' ) ) {
function jh_child_extra_register_fields() {
?>
<p>
<label for="jobhunt_register_first_name"><?php esc_html_e( 'First Name', 'jobhunt' ); ?>
<input name="jobhunt_first_name" id="jobhunt_register_first_name" class="required" type="text"/>
</label>
</p>
<p>
<label for="jobhunt_register_last_name"><?php esc_html_e( 'Last Name', 'jobhunt' ); ?>
@yousufansa
yousufansa / functions.php
Created January 18, 2019 06:16
Bethlehem - Events Calendar Pro Fix
if( class_exists( 'Tribe__Events__Pro__Main' ) ) {
remove_action( 'tribe_events_single_event_after_the_meta', array( Tribe__Events__Pro__Main::instance(), 'register_related_events_view' ) );
add_action( 'tribe_events_single_event_after_the_content', array( Tribe__Events__Pro__Main::instance(), 'register_related_events_view' ) );
}
@yousufansa
yousufansa / style.css
Created January 25, 2019 08:36
Jobhunt - Job Manager Select2 Style Issue
.select2-selection.select2-selection--multiple {
background-color: #f9fafa;
border: 2px solid #d4d9dd;
min-height: 44px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
border: 2px solid #8c9aa6;
}
@yousufansa
yousufansa / functions.php
Created January 28, 2019 07:07
Jobhunt - Post A Job Button On Administrator / Employer
if ( ! function_exists( 'jh_child_header_post_a_job_button_for_employer' ) ) {
function jh_child_header_post_a_job_button_for_employer( $current_status ) {
$user = wp_get_current_user();
if ( $current_status && is_user_logged_in() && ( in_array( 'employer', (array) $user->roles ) || in_array( 'administrator', (array) $user->roles ) ) ) {
return $current_status;
} else {
return false;
}
}
}
@yousufansa
yousufansa / functions.php
Created February 1, 2019 06:26
Jobhunt - Add Job Career Level On Job Listings
if ( ! function_exists( 'jh_child_template_job_listing_career_level' ) ) {
function jh_child_template_job_listing_career_level() {
global $post;
if( !empty( $career_level = jobhunt_get_wpjm_taxomony_data( $post, 'job_listing_career_level', false ) ) ) {
echo '<div class="job_listing-career_level"><label>' . esc_html__( 'Career Level:', 'jobhunt-child' ) . '</label>' . $career_level . '</div>';
}
}
}
add_action( 'jobhunt_job_listing_title', 'jh_child_template_job_listing_career_level', 75 );
@yousufansa
yousufansa / functions.php
Created February 1, 2019 06:45
Jobhunt - Add Job Description On Job Listings
if ( ! function_exists( 'jh_child_template_job_listing_desc' ) ) {
function jh_child_template_job_listing_desc() {
echo '<div class="job_listing-description">';
the_excerpt();
echo '</div>';
}
}
add_action( 'jobhunt_after_job_listing', 'jh_child_template_job_listing_desc', 105 );
@yousufansa
yousufansa / functions.php
Created February 6, 2019 12:13
Electro - Show only Specific Brands By Slug in Custom Order
if ( ! function_exists( 'ec_child_footer_bc_modify_tax_args' ) ) {
function ec_child_footer_bc_modify_tax_args( $args ) {
$args['slugs'] = 'dell, apple, microsoft, ibm, sony, samsung, hp'; //Replace slugs with your slugs in need order
if ( ! empty( $args['slugs'] ) ) {
$cat_slugs = is_array( $args['slugs'] ) ? $args['slugs'] : explode( ',', $args['slugs'] );
$cat_slugs = array_map( 'trim', $cat_slugs );
$args['slug'] = $cat_slugs;
$args['orderby'] = 'slug__in';