| Server IP : 152.53.162.115 / Your IP : 216.73.217.85 Web Server : Apache/2 System : Linux host 6.12.0-55.40.1.el10_0.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Oct 21 05:54:51 EDT 2025 x86_64 User : pbshosting ( 1005) PHP Version : 8.3.30 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/pbshosting/domains/arunoommen.com/private_html/wp-content/themes/Theme21/ |
Upload File : |
<?php
/*
Template Name: Gallery Template
*/
?>
<?php get_header(); ?>
<div id="container" class="site-content">
<div id="content" class="hentry">
<h1 class="home_page_title entry-header"><?php the_title(); ?></h1>
<?php if ( function_exists( 'pdfprnt_show_buttons_for_custom_post_type' ) )
echo pdfprnt_show_buttons_for_custom_post_type( 'post_type=gallery&orderby=post_date' ); ?>
<div class="gallery_box entry-content">
<ul>
<?php global $post, $wpdb, $wp_query, $request;
if ( get_query_var( 'paged' ) ) {
$paged = get_query_var( 'paged' );
} elseif ( get_query_var( 'page' ) ) {
$paged = get_query_var( 'page' );
} else {
$paged = 1;
}
$permalink = get_permalink();
$gllr_options = get_option( 'gllr_options' );
$count = 0;
$per_page = $showitems = get_option( 'posts_per_page' );
$count_all_albums = $wpdb->get_var( "SELECT COUNT(*) FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'gallery' AND (wp_posts.post_status = 'publish')" );
if ( substr( $permalink, strlen( $permalink ) -1 ) != "/" ) {
if ( strpos( $permalink, "?" ) !== false ) {
$permalink = substr( $permalink, 0, strpos( $permalink, "?" ) -1 ) . "/";
} else {
$permalink .= "/";
}
}
$args = array(
'post_type' => 'gallery',
'post_status' => 'publish',
'orderby' => 'post_date',
'posts_per_page' => $per_page,
'paged' => $paged
);
$second_query = new WP_Query( $args );
if ( function_exists( 'pdfprnt_show_buttons_for_custom_post_type' ) )
echo pdfprnt_show_buttons_for_custom_post_type( $second_query );
$request = $second_query->request;
if ( $second_query->have_posts() ) :
while ( $second_query->have_posts() ) : $second_query->the_post();
$attachments = get_post_thumbnail_id( $post->ID );
if ( empty ( $attachments ) ) {
$attachments = get_children( 'post_parent='.$post->ID.'&post_type=attachment&post_mime_type=image&numberposts=1' );
$id = key( $attachments );
$image_attributes = wp_get_attachment_image_src( $id, 'album-thumb' );
} else {
$image_attributes = wp_get_attachment_image_src( $attachments, 'album-thumb' );
}
if ( 1 == $gllr_options['border_images'] ) {
$gllr_border = 'border-width: ' . $gllr_options['border_images_width'].'px; border-color:'.$gllr_options['border_images_color'].'; padding:0;';
$gllr_border_images = $gllr_options['border_images_width'] * 2;
} else {
$gllr_border = 'padding:0;';
$gllr_border_images = 0;
}
$count++; ?>
<li>
<a rel="bookmark" href="<?php echo get_permalink(); ?>" title="<?php echo htmlspecialchars( $post->post_title ); ?>">
<img style="width:<?php echo $gllr_options['gllr_custom_size_px'][0][0]; ?>px; <?php echo $gllr_border; ?>" alt="<?php echo htmlspecialchars( $post->post_title ); ?>" title="<?php echo htmlspecialchars( $post->post_title ); ?>" src="<?php echo $image_attributes[0]; ?>" />
</a>
<div class="gallery_detail_box">
<div><?php echo htmlspecialchars( $post->post_title ); ?></div>
<div><?php echo the_excerpt_max_charlength( 100 ); ?></div>
<a href="<?php echo $permalink; echo basename( get_permalink( $post->ID ) ); ?>"><?php echo $gllr_options["read_more_link_text"]; ?></a>
</div>
<div class="clear"></div>
</li>
<?php endwhile;
endif;
wp_reset_query();
$request = $wp_query->request; ?>
</ul>
<?php $pages = intval ( $count_all_albums / $per_page );
if ( $count_all_albums % $per_page > 0 )
$pages += 1;
$range = 100;
if ( ! $pages ) {
$pages = 1;
}
if ( 1 != $pages ) { ?>
</div><!-- .gallery_box -->
<div class='clear'></div>
<div class='pagination'>
<?php for ( $i = 1; $i <= $pages; $i++ ) {
if ( 1 != $pages && ( !( $i >= $paged + $range + 1 || $i <= $paged - $range - 1 ) || $pages <= $showitems ) ) {
echo ( $paged == $i ) ? "<span class='current'>". $i ."</span>":"<a href='". get_pagenum_link($i) ."' class='inactive' >". $i ."</a>";
}
} ?>
<div class='clear'></div>
</div><!-- .pagination -->
<?php } else { ?>
</div><!-- .gallery_box -->
<?php }
comments_template(); ?>
</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>