| Server IP : 104.21.28.229 / Your IP : 216.73.216.142 Web Server : Apache/2 System : Linux hosting8537.lvs 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : mienphi ( 1014) PHP Version : 8.2.14 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/mienphi/public_html/wp-content/themes/eduma/inc/widgets/single-images/tpl/ |
Upload File : |
<?php
$link_before = $after_link = $image = $images_size = '';
$src = wp_get_attachment_image_src( $instance['image'], $instance['image_size'] );
$on_click_action = ( isset( $instance['on_click_action'] ) && $instance['on_click_action'] != '' ) ? $instance['on_click_action'] : 'none';
$target = isset($instance['link_target']) ? $instance['link_target'] : '_self';
$text_align = ( isset($instance['image_alignment']) && '' != $instance['image_alignment'] ) ? 'text-'.$instance['image_alignment'] : '';
if($on_click_action == 'custom-link'){
if ( $instance['image_link'] ) {
$link_before = '<a target="' . $target . '" href="' . esc_url( $instance['image_link'] ) . '">';
$after_link = "</a>";
}
}elseif($on_click_action == 'popup'){
wp_enqueue_script( 'magnific-popup');
$link_before = '<a class="thim-single-image-popup" href="' . esc_url( $src[0] ) . '">';
$after_link = "</a>";
}
echo '<div class="single-image ' . $text_align . '">' . $link_before;
if ( $src ) {
if(strpos($instance['image_size'],'x')) {
$size = explode('x', $instance['image_size']);
echo thim_get_feature_image( $instance['image'], 'full', $size[0], $size[1] );
} else {
$alt = get_post_meta( $instance['image'], '_wp_attachment_image_alt', true ) ? get_post_meta( $instance['image'], '_wp_attachment_image_alt', true ) : '';
echo '<img src ="' . $src['0'] . '" width="' . $src[1] . '" height="' . $src[2] . '" alt="'.$alt.'"/>';
}
}
echo $after_link . '</div>';