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 November 30, 2020 04:58
Vodi - Display Movie Tags on Single Movie Page
if ( ! function_exists( 'vodi_child_single_movie_meta_tag' ) ) {
function vodi_child_single_movie_meta_tag() {
global $movie;
$tag = get_the_term_list( $movie->get_id(), 'movie_tag', '', ', ' );
if( ! empty ( $tag ) ) {
echo '<span class="movie__meta--genre">' . $tag . '</span>';
}
}
@yousufansa
yousufansa / functions.php
Created November 27, 2020 18:30
Jobhunt - Change Related Jobs Title Text
if ( ! function_exists( 'jh_child_modify_single_job_listing_related_jobs_title' ) ) {
function jh_child_modify_single_job_listing_related_jobs_title( $title ) {
return "Your Custom Title";
}
}
add_filter( 'jobhunt_single_job_listing_related_jobs_title', 'jh_child_modify_single_job_listing_related_jobs_title' );
@yousufansa
yousufansa / functions.php
Created November 27, 2020 18:07
Jobhunt - Remove Catalog Ordering Dropdown From Job Listings Page
if( ! function_exists( 'jh_child_remove_catalog_ordering' ) ) {
function jh_child_remove_catalog_ordering() {
remove_action( 'jobhunt_before_job_listing_loop', 'jobhunt_wpjm_job_catalog_ordering', 40 );
}
}
add_action( 'jobhunt_before_job_listing_loop', 'jh_child_remove_catalog_ordering', 5 );
@yousufansa
yousufansa / style.css
Created November 27, 2020 14:10
Stretch the Content to Screen Width
.stretch-full-width {
width: 100vw;
position: relative;
margin-left: calc(-50vw + 50% - 8px);
}
@media (max-width: 991.98px) {
.stretch-full-width {
margin-left: calc(-50vw + 50%);
}
@yousufansa
yousufansa / style.css
Created November 27, 2020 13:56
Front - Hero Video block with Background Image
.wp-block-fgb-hero-video .js-bg-video[data-hs-bgv-path$=".jpg"],
.wp-block-fgb-hero-video .js-bg-video[data-hs-bgv-path$=".jpeg"],
.wp-block-fgb-hero-video .js-bg-video[data-hs-bgv-path$=".png"] {
opacity: 0;
}
@yousufansa
yousufansa / functions.php
Created November 27, 2020 10:12
Electro - Disable the Sticky Mobile Header on Checkout Page
if( ! function_exists( 'ec_child_disable_handheld_header_sticky' ) ) {
function ec_child_disable_handheld_header_sticky( $sticky_header ) {
if( function_exists( 'is_checkout' ) && is_checkout() ) {
return false;
}
return $sticky_header;
}
}
add_filter( 'electro_enable_hh_sticky_header', 'ec_child_disable_handheld_header_sticky', 20 );
@yousufansa
yousufansa / style.css
Created November 25, 2020 11:46
Electro v2 - Change Add to Cart Icon with Shopping Bag Icon
.owl-item>.product .button.add_to_cart_button::before,
.products-carousel.electro-v1 .owl-item .product .button.add_to_cart_button::before,
.section-onsale-product .onsale-product .button.add_to_cart_button::before,
.section-onsale-product-carousel .onsale-product-carousel .onsale-product .onsale-product-content .button.add_to_cart_button::before,
li.product .button.add_to_cart_button::before,
.single_add_to_cart_button.button::before {
content: "\6e";
font-family: font-electro;
}
@yousufansa
yousufansa / functions.php
Created November 25, 2020 06:53
Cartzilla Marketplace - Fix for Error on Products page with Vendor Subscription Module
if ( ! function_exists( 'cartzilla_dokan_show_custom_subscription_info' ) ) {
function cartzilla_dokan_show_custom_subscription_info() {
$vendor_id = dokan_get_current_user_id();
if ( dokan_is_seller_enabled( $vendor_id ) ) {
$remaining_product = \DokanPro\Modules\Subscription\Helper::get_vendor_remaining_products( $vendor_id );
if ( '-1' === $remaining_product ) {
return printf( '<p class="dokan-info">%s</p>', esc_html__( 'You can add unlimited products', 'cartzilla' ) );
@yousufansa
yousufansa / functions.php
Created November 23, 2020 15:43
Bookworm - Add HTML Support on Footer Copyright Bar
if ( ! function_exists( 'bookworm_site_info' ) ) {
function bookworm_site_info( $wrapper_classes='', $wrapper_inner_classes='', $copyright_text_classes='',$right_column_wrapper_classes='', $footer_version='' ) {
if( empty( $footer_version ) ) {
$footer_version = apply_filters( 'bookworm_footer_version', get_theme_mod( 'footer_version', 'v1' ) );
}
$copyright_text = apply_filters( 'bookworm_copyright', get_theme_mod( 'bookworm_copyright_text', sprintf( esc_html__( '%s %s. All Rights Reserved', 'bookworm' ), date( 'Y' ), get_bloginfo( 'name' ) ) ) );
?><div class="<?php echo esc_attr( $wrapper_classes ); ?>">
<div class="container">
<div class="<?php echo esc_attr( $wrapper_inner_classes ); ?>">
@yousufansa
yousufansa / functions.php
Created November 23, 2020 13:41
Vodi - Single Movie v6 Re-Arrange the single movie description to top on the movie feature crew
if ( ! function_exists( 'vodi_child_template_single_movie_v6_rearrange_movie_description' ) ) {
function vodi_child_template_single_movie_v6_rearrange_movie_description() {
if ( vodi_get_single_movie_style() == 'v6' ) {
add_filter( 'masvideos_movie_attribute', 'vodi_template_single_movie_attribute', 10, 3 );
add_action( 'masvideos_single_movie_summary', 'vodi_template_single_movie_details', 28 );
remove_action( 'masvideos_after_single_movie_summary', 'vodi_template_single_movie_details', 15 );
}
}
}
add_action( 'masvideos_before_single_movie', 'vodi_child_template_single_movie_v6_rearrange_movie_description', 20 );