Skip to content

Instantly share code, notes, and snippets.

@farookibrahim
farookibrahim / functions.php
Created June 15, 2020 16:18
Cartzilla - Add custom Google Font
if( ! function_exists( 'cz_child_custom_google_font_families_roboto' ) ) {
function cz_child_custom_google_font_families_roboto( $fonts ) {
$fonts['roboto'] = 'Roboto:100,300,400,500,700,900';
return $fonts;
}
}
add_filter( 'cartzilla_google_font_families', 'cz_child_custom_google_font_families_roboto', 20 );
@farookibrahim
farookibrahim / functions.php
Created June 15, 2020 08:20
Electro - Typography add custom fonts
if( ! function_exists( 'el_child_custom_typography_options_args' ) ) {
function el_child_custom_typography_options_args( $args ) {
$fonts = array(
'Open Sans,arial,helvatica' => 'Open Sans',
'BebasRegular,arial,helvatica' => 'Bebas Regular',
'LeagueGothicRegular,arial,helvatica' => 'League Gothic Regular',
'Arial,helvetica,sans-serif' => 'Arial',
'helvetica,sans-serif,arial' => 'Helvatica',
'sans-serif,arial,helvatica' => 'Sans Serif',
'verdana,san-serif,helvatica' => 'Verdana',
@farookibrahim
farookibrahim / functions.php
Created June 12, 2020 13:52
Vodi - StreamingAsAService Player SC
function vi_streamingasaservice_player_sc( $atts ) {
extract(shortcode_atts(array(
'id' => '',
), $atts));
ob_start();
if( ! empty( $id ) ) {
?>
<script id="<?php echo esc_attr( $id ); ?>" width="1280" height="720" src="https://player.streamingasaservice.net/js/player.js?contentId=<?php echo esc_attr( $id ); ?>" class="cnc-saas-vid"></script>
<?php
@farookibrahim
farookibrahim / functions.php
Created June 12, 2020 09:08
Electro - Single product page add recently viewed products after recommended products
/**
* Track product views.
*/
if( ! function_exists( 'electro_wc_track_product_view' ) ) {
function electro_wc_track_product_view() {
if ( ! is_singular( 'product' ) ) {
return;
}
global $post;
@farookibrahim
farookibrahim / functions.php
Created June 11, 2020 14:07
Cartzilla - WC Products archive image size width
if ( ! function_exists( 'cz_child_woocommerce_args' ) ) {
function cz_child_woocommerce_args( $args ) {
$args['thumbnail_image_width'] = 400;
return $args;
}
}
add_filter( 'cartzilla_woocommerce_args', 'cz_child_woocommerce_args' );
@farookibrahim
farookibrahim / functions.php
Created June 10, 2020 09:09
Techmarket - Disable Pace
add_filter( 'techmarket_enable_pace', '__return_false', 99 );
@farookibrahim
farookibrahim / functions.php
Created June 10, 2020 07:18
Vodi - Single Episode v1 after player custom content
if ( ! function_exists( 'vodi_template_single_before_content' ) ) {
function vodi_template_single_before_content() {
?>Your after custom content<?php
}
}
add_action( 'masvideos_before_single_episode_summary', 'vodi_template_single_before_content', 79 );
@farookibrahim
farookibrahim / functions.php
Created June 10, 2020 07:18
Vodi - Single Episode v1 before player custom content
if ( ! function_exists( 'vodi_template_single_episode_after_content' ) ) {
function vodi_template_single_episode_after_content() {
?>Your before custom content<?php
}
}
add_action( 'masvideos_before_single_episode_summary', 'vodi_template_single_episode_after_content', 5 );
@farookibrahim
farookibrahim / functions.php
Created June 10, 2020 07:09
Vodi - TV Shows archive after custom content
if ( ! function_exists( 'vodi_tv_show_archive_after_content' ) ) {
function vodi_tv_show_archive_after_content() {
if ( vodi_is_masvideos_activated() && is_tv_shows() ) {
?>TV Shows after custom content<?php
}
}
}
add_action( 'masvideos_after_main_content', 'vodi_tv_show_archive_after_content', 20 );
@farookibrahim
farookibrahim / functions.php
Created June 10, 2020 07:08
Vodi - TV Shows archive before custom content
if ( ! function_exists( 'vodi_tv_show_archive_before_content' ) ) {
function vodi_tv_show_archive_before_content() {
if ( vodi_is_masvideos_activated() && is_tv_shows() ) {
?>TV Shows before custom content<?php
}
}
}
add_action( 'masvideos_before_main_content', 'vodi_tv_show_archive_before_content', 20 );