This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function momoth_redirect_attachment_page() { | |
if ( is_attachment() ) { | |
global $post; | |
if ( $post && $post->post_parent ) { | |
wp_redirect( esc_url( get_permalink( $post->post_parent ) ), 301 ); | |
exit; | |
} else { | |
wp_redirect( esc_url( home_url( '/' ) ), 301 ); | |
exit; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get user IP in WordPress | |
function get_the_user_ip() { | |
if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { | |
//check ip from share internet | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { | |
//to check ip is pass from proxy | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
$ip = $_SERVER['REMOTE_ADDR']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="slideshow"> | |
<ul class="bxslider"> | |
{% for image in images %} | |
<li><img src="{{image.url}}" alt=""></li> | |
{% endfor %} | |
</ul> | |
<div class="gallery-thumbs-container"> | |
<ul id="gallery-thumbs" class="gallery-thumbs-list"> | |
{% for image in images %} | |
<li class="thumb-item"> |
OlderNewer