Skip to content

Instantly share code, notes, and snippets.

@congthien
Created September 21, 2017 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save congthien/358de3697cdaa09ce53ab792289adcc8 to your computer and use it in GitHub Desktop.
Save congthien/358de3697cdaa09ce53ab792289adcc8 to your computer and use it in GitHub Desktop.
<?php
$lang = qtranxf_getLanguage();
if ( $lang == 'en' ) {
$video = 'your video link in English';
} else if( $lang == 'ru' ) {
$video = 'your video link in Ru';
} else {
$video = get_theme_mod( 'onepress_videolightbox_url' );
}
$id = get_theme_mod( 'onepress_videolightbox_id', 'videolightbox' );
$disable = get_theme_mod( 'onepress_videolightbox_disable' ) == 1 ? true : false;
$heading = get_theme_mod( 'onepress_videolightbox_title' );
if ( ! $disable && ( $video || $heading ) ) {
$image = get_theme_mod( 'onepress_videolightbox_image' );
?>
<?php if ( ! onepress_is_selective_refresh() ){ ?>
<section id="<?php if ($id != '') echo esc_attr( $id ); ?>" <?php do_action('onepress_section_atts', 'videolightbox'); ?> class="<?php echo esc_attr(apply_filters('onepress_section_class', 'section-videolightbox section-padding section-padding-larger section-inverse onepage-section', 'videolightbox')); ?>">
<?php } ?>
<?php do_action('onepress_section_before_inner', 'videolightbox'); ?>
<div class="<?php echo esc_attr( apply_filters( 'onepress_section_container_class', 'container', 'videolightbox' ) ); ?>">
<?php if ( $video ) { ?>
<div class="videolightbox__icon videolightbox-popup">
<a href="<?php echo esc_attr( $video ); ?>" data-scr="<?php echo esc_attr( $video ); ?>" class="popup-video">
<span class="video_icon"><i class="fa fa-play"></i></span>
</a>
</div>
<?php } ?>
<?php if ( $heading ) { ?>
<h2 class="videolightbox__heading"><?php echo do_shortcode( wp_kses_post( $heading ) ); ?></h2>
<?php } ?>
</div>
<?php do_action('onepress_section_after_inner', 'videolightbox'); ?>
<?php if ( ! onepress_is_selective_refresh() ){ ?>
</section>
<?php } ?>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment