| Server IP : 119.59.104.26 / Your IP : 216.73.217.55 Web Server : Apache/2 System : Linux ns69.hostinglotus.net 4.18.0-553.141.2.el8_10.x86_64 #1 SMP Wed Jul 8 10:28:18 EDT 2026 x86_64 User : com12370 ( 1517) PHP Version : 7.2.34 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/com12370/public_html/wp-content/themes/titan/admin/customize/plugins/views/content/ |
Upload File : |
<?php
/**
* Created by PhpStorm.
* User: wiloke
* Date: 7/12/15
* Time: 8:28 PM
*/
/*Related Posts*/
function pi_render_related_posts()
{
$status = piBlogCustomize::pi_refresh_in_customize("pi_options[content][related_posts][toggle]") ? piBlogCustomize::pi_refresh_in_customize("pi_options[related_posts][toggle]") : piBlogFramework::$piOptions['content']['related_posts']['toggle'];
$status = $status == "disable" || $status == '0' ? 0 : $status;
if ( !empty($status) )
{
do_action('pi_before_related_posts');
$by = piBlogCustomize::pi_refresh_in_customize('pi_options[content][related_posts][get_by]') ? piBlogCustomize::pi_refresh_in_customize('pi_options[content][related_posts][get_by]') : piBlogFramework::$piOptions['content']['related_posts']['get_by'];
global $post;
if ( $by != 'tag' )
{
$getTerms = get_the_category($post->ID);
$key = 'category__in';
}else{
$getTerms = wp_get_post_tags($post->ID);
$key = 'tag__in';
}
if ( $getTerms ) :
foreach ( $getTerms as $term )
{
$aBy[] = $term->term_id;
}
$args=array(
'post__not_in' => array($post->ID),
'posts_per_page' => 3,
'ignore_sticky_posts' => 1
);
$args[$key] = $aBy;
$query = new WP_Query($args);
if( $query->have_posts() ) :
?>
<div class="related-post pi-related_posts">
<?php pi_render_related_posts_title(); ?>
<div class="pi-row">
<?php
while ($query->have_posts()) : $query->the_post();
?>
<div class="pi-three-column">
<div class="related-post-item">
<div class="post-media">
<div class="image-wrap">
<a href="<?php esc_url(the_permalink()); ?>" rel="bookmark">
<?php
if ( has_post_thumbnail() )
{
the_post_thumbnail('pi-relate-post');
}
?>
</a>
</div>
</div>
<div class="post-body">
<div class="post-title">
<h2><a href="<?php esc_url(the_permalink()); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
</div>
</div>
</div>
</div>
<?php
endwhile;
?>
</div>
</div>
<?php
endif;wp_reset_postdata();
endif;
do_action('pi_after_related_posts');
}
}
function pi_render_related_posts_title()
{
$title = piBlogCustomize::pi_refresh_in_customize("pi_options[content][related_posts][title]") ? piBlogCustomize::pi_refresh_in_customize("pi_options[content][related_posts][title]") : piBlogFramework::$piOptions['content']['related_posts']['title'];
if ( !empty($title) )
{
do_action('pi_before_related_posts_title');
if ( has_filter('pi_related_posts_title') )
{
$title = apply_filters('pi_related_posts_title', $title);
}else{
$title = '<h3 class="related-post-title">'.$title.'</h3>';
}
echo wp_unslash($title);
do_action('pi_after_related_posts_title');
}
}
/*End / Related Posts*/
function pi_is_hide_featured_image()
{
$toggle = piBlogCustomize::pi_refresh_in_customize("pi_options[content][featured_image][toggle]") ? piBlogCustomize::pi_refresh_in_customize("pi_options[content][featured_image][toggle]") : piBlogFramework::$piOptions['content']['featured_image']['toggle'];
$toggle = $toggle == 'disable' || $toggle == '0' ? false : $toggle;
return $toggle;
}
function pi_is_show_author_box()
{
$toggle = piBlogCustomize::pi_refresh_in_customize("pi_options[content][author_box]") ? piBlogCustomize::pi_refresh_in_customize("pi_options[content][author_box]") : piBlogFramework::$piOptions['content']['author_box'];
$toggle = $toggle == 'disable' || $toggle == '0' ? false : $toggle;
return $toggle;
}
function pi_render_next_prev_post_link()
{
$status = !piBlogCustomize::pi_refresh_in_customize("pi_options[content][next_prev]") ? piBlogFramework::$piOptions['content']['next_prev'] : piBlogCustomize::pi_refresh_in_customize("pi_options[content][next_prev]");
$status = $status == "disable" || $status == '0' ? 0 : $status;
if ( $status )
{
global $post;
$nextPost = get_next_post();
$prevPost = get_previous_post();
?>
<div class="pi-nav-thumbnail">
<?php if ( !empty($prevPost) ) : ?>
<div class="prev">
<a href="<?php echo get_permalink($prevPost->ID);?>">
<div class="image-cover">
<?php if ( has_post_thumbnail($prevPost->ID) ) : ?>
<?php echo get_the_post_thumbnail($prevPost->ID, 'thumbnail'); ?>
<?php endif; ?>
</div>
<h4><?php echo esc_html($prevPost->post_title); ?></h4>
<i class="fa fa-angle-left"></i>
</a>
</div>
<?php endif; ?>
<?php if ( !empty($nextPost) ) : ?>
<div class="next">
<a href="<?php echo get_permalink($nextPost->ID);?>">
<div class="image-cover">
<?php if ( has_post_thumbnail($nextPost->ID) ) : ?>
<?php echo get_the_post_thumbnail($nextPost->ID, 'thumbnail'); ?>
<?php endif; ?>
</div>
<h4><?php echo esc_html($nextPost->post_title); ?></h4>
<i class="fa fa-angle-right"></i>
</a>
</div>
<?php endif; ?>
</div>
<?php
}
}
?>