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 December 2, 2020 05:35
Vodi - Display Person Died on Single Person
if ( ! function_exists( 'vodi_child_single_person_deathday' ) ) {
/**
* Person deathday in the single person.
*/
function vodi_child_single_person_deathday() {
global $person;
$deathday = $person->get_deathday();
if( ! empty( $deathday ) ) :
$date = $deathday->getOffsetTimestamp();
$title = apply_filters( 'vodi_child_single_person_deathday_title_text', __( 'Died', 'masvideos' ) );
@yousufansa
yousufansa / functions.php
Created December 2, 2020 05:28
Vodi - Single Person Birthday Date Showing Previous Date Fix
if ( ! function_exists( 'masvideos_template_single_person_birthday' ) ) {
/**
* Person birthday in the single person.
*/
function masvideos_template_single_person_birthday() {
global $person;
$birthday = $person->get_birthday();
if( ! empty( $birthday ) ) :
$date = $birthday->getOffsetTimestamp();
$title = apply_filters( 'masvideos_template_single_person_birthday_title_text', __( 'Birthday', 'masvideos' ) );
@yousufansa
yousufansa / functions.php
Last active December 2, 2020 05:01
Vodi - Remove playlist feature from Movie, Video & TV Show
if( ! function_exists( 'vodi_child_mv_customize_account_menu_items' ) ) {
function vodi_child_mv_customize_account_menu_items( $items, $endpoints ) {
unset( $items['movie-playlists'] );
unset( $items['video-playlists'] );
unset( $items['tv-show-playlists'] );
return $items;
}
}
add_filter( 'masvideos_account_menu_items', 'vodi_child_mv_customize_account_menu_items', 20, 2 );
@yousufansa
yousufansa / functions.php
Last active December 1, 2020 13:19
Electro - Display custom data below short description on single product page
if( ! function_exists( 'ec_child_single_product_summary_custom_content' ) ) {
function ec_child_single_product_summary_custom_content() {
$static_block_id = 0;
if ( ! empty( $static_block_id ) && $static_block_id > 0 ) {
$static_block = get_post( $static_block_id );
if( is_wp_error( $static_block ) ) return;
echo do_shortcode( $static_block->post_content );
}
}
}
@yousufansa
yousufansa / functions.php
Created December 1, 2020 06:03
Vodi - Display IMDB ID on Single Movie Meta
if ( ! function_exists( 'vodi_template_single_movie_imdb_id' ) ) {
/**
* Movie imdb id in the movie single.
*/
function vodi_template_single_movie_imdb_id() {
global $movie;
if( is_movie() ) {
$imdb_id = get_post_meta( $movie->get_ID(), '_imdb_id', true );
@yousufansa
yousufansa / functions.php
Created December 1, 2020 05:55
Vodi - Toggle the description and short description position on the single movie v7
if ( ! function_exists( 'vodi_toggle_single_movie_v7_desc_and_short_desc_hooks' ) ) {
function vodi_toggle_single_movie_v7_desc_and_short_desc_hooks() {
if ( vodi_get_single_movie_style() == 'v7' ) {
remove_action( 'masvideos_single_movie_summary', 'masvideos_template_single_movie_short_desc', 25 );
remove_action( 'masvideos_after_single_movie_summary', 'vodi_template_single_movie_details', 60 );
add_action( 'masvideos_single_movie_summary', 'vodi_template_single_movie_details', 25 );
add_action( 'masvideos_after_single_movie_summary', 'masvideos_template_single_movie_short_desc', 62 );
}
}
}
@yousufansa
yousufansa / content-single-job_listing-company.php
Created November 30, 2020 17:32
Jobhunt - Single Job Company Logo on Single Company Template
<?php
/**
* Single view Company information box
*
* Hooked into single_job_listing_start priority 30
*
* This template can be overridden by copying it to yourtheme/job_manager/content-single-job_listing-company.php.
*
* @see https://wpjobmanager.com/document/template-overrides/
* @author Automattic
@yousufansa
yousufansa / functions.php
Created November 30, 2020 17:29
Jobhunt - Single Job Company Logo Full Size
if ( ! function_exists( 'jh_child_company_logo_args_size' ) ) {
function jh_child_company_logo_args_size( $args ) {
$args['size'] = 'full';
return $args;
}
}
add_filter( 'jobhunt_company_logo_args', 'jh_child_company_logo_args_size' );
@yousufansa
yousufansa / functions.php
Created November 30, 2020 10:20
Jobhunt - Display Single Job Overview Custom Title
if ( ! function_exists( 'jh_child_custom_single_job_overview_title' ) ) {
function jh_child_custom_single_job_overview_title( $title ) {
return 'Your Overview Title'; //Replace Your Single Job Overview Title with your text
}
}
add_filter( 'jobhunt_single_job_overview_title', 'jh_child_custom_single_job_overview_title' );
@yousufansa
yousufansa / functions.php
Created November 30, 2020 09:23
Electro - Product Flicker on Product Hover Fix
if( ! function_exists( 'ec_child_product_flicker_on_hover_fix' ) ) {
function ec_child_product_flicker_on_hover_fix() {
ob_start(); ?>
(function ($) {
"use strict";
$(window).load(function(){
$('.products .product').each(function(){
$(this).css({
'min-height': $(this).height()
})