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 May 28, 2019 09:08
Vodi - Single Movie Related Movies Hook Toggle
if( ! function_exists( 'vodi_child_related_movies_custom_hook_toggle' ) ) {
function vodi_child_related_movies_custom_hook_toggle() {
if( vodi_get_single_movie_style() === 'v1' ) {
remove_action( 'masvideos_after_single_movie_summary', 'masvideos_related_movies', 20 );
add_action( 'masvideos_after_single_movie_summary', 'masvideos_related_movies', 40 );
}
}
}
add_action( 'init', 'vodi_child_related_movies_custom_hook_toggle' );
@yousufansa
yousufansa / functions.php
Created June 13, 2019 05:29
Jobhunt - Job Archive Page Header Subtitle Add/Change
if ( ! function_exists( 'jh_child_custom_wpjm_page_subtitle' ) ) {
function jh_child_custom_wpjm_page_subtitle( $subtitle ) {
if( is_post_type_archive( 'job_listing' ) || is_page( jh_wpjm_get_page_id( 'jobs' ) ) ) {
$subtitle = esc_html__( 'Your Subtitle', 'jobhunt-child' );
}
return $subtitle;
}
}
add_filter( 'jobhunt_site_content_page_subtitle', 'jh_child_custom_wpjm_page_subtitle', 20 );
@yousufansa
yousufansa / functions.php
Created June 13, 2019 15:07
Electro - Elementor Pro Custom Header/Footer Issue Fix
if ( ! function_exists( 'el_child_get_header_after' ) ) {
function el_child_get_header_after() {
if( did_action( 'elementor_pro/init' ) ) {
?>
<div id="content" class="site-content" tabindex="-1">
<div class="container">
<?php
}
}
}
@yousufansa
yousufansa / functions.php
Created June 21, 2019 13:13
Jobhunt - Change Job Taxonomy Description Position
if( ! function_exists( 'jh_child_job_listing_taxonomy_description_change' ) ) {
function jh_child_job_listing_taxonomy_description_change() {
if( is_job_listing_taxonomy() ) {
add_filter( 'jobhunt_site_content_page_subtitle', function( $subtitle ) { return; } );
add_action( 'jobhunt_before_job_listing_loop_content', 'the_archive_description' );
}
}
}
add_action( 'jobhunt_before_content', 'jh_child_job_listing_taxonomy_description_change', 10 );
@yousufansa
yousufansa / functions.php
Created June 27, 2019 15:26
Electro - Single Product Gallery Navigation
function el_child_wc_gallery_options( $options ) {
$options['directionNav'] = true;
return $options;
}
add_filter( 'woocommerce_single_product_carousel_options', 'el_child_wc_gallery_options', 99 );
@yousufansa
yousufansa / functions.php
Created June 28, 2019 05:51
Jobhunt - Move Apply Job Button Bellow Description in Mobile View
add_action( 'single_job_listing', 'jobhunt_single_job_listing_application', 25 );
@yousufansa
yousufansa / functions.php
Created July 5, 2019 15:02
Vodi - Add Menu Item on Header User Dropdown Menu
if ( ! function_exists( 'vodi_child_modify_header_user_account_menu_items' ) ) {
function vodi_child_modify_header_user_account_menu_items( $user_account_menu_items ) {
$user_account_menu_items['example'] = array(
'title' => __( 'Example', 'vodi-child' ),
'href' => 'www.google.com',
);
return $user_account_menu_items;
}
}
add_filter( 'vodi_header_user_account_menu_items', 'vodi_child_modify_header_user_account_menu_items', 10 );
@yousufansa
yousufansa / functions.php
Created July 5, 2019 15:03
Vodi - Remove Single Video Show Hide
if ( ! function_exists( 'vodi_child_remove_single_video_show_hide' ) ) {
function vodi_child_remove_single_video_show_hide( $value ) {
if ( is_video() ) {
return false;
}
return $value;
}
}
add_filter( 'vodi_enable_vodi_readmore', 'vodi_child_remove_single_video_show_hide', 10 );
@yousufansa
yousufansa / functions.php
Created July 5, 2019 15:04
Vodi - Single Movie Remove Related Movie ( You May Also Like ) Block
remove_action( 'masvideos_after_single_movie_summary', 'masvideos_related_movies', 20 );
@yousufansa
yousufansa / functions.php
Created July 11, 2019 05:59
Jobhunt - Login User Redirect to Woocommerce Dashboard ( roles except employer and candidate )
// logs a member in after submitting a form
if ( ! function_exists( 'jobhunt_login_member' ) ) {
function jobhunt_login_member() {
if( isset( $_POST['jobhunt_login_check'] ) && wp_verify_nonce( $_POST['jobhunt_login_nonce'], 'jobhunt-login-nonce') ) {
// this returns the user ID and other info from the user name
if ( is_email( $_POST['jobhunt_user_login'] ) ) {
$user = get_user_by( 'email', $_POST['jobhunt_user_login'] );
} else {
$user = get_user_by( 'login', $_POST['jobhunt_user_login'] );