File: /www/wwwroot/ahmsolaiman.com/wp-content/themes/ahm/single-thesiss.php
<?php
// Exit if accessed directly
if (!defined('ABSPATH')) exit;
/**
*Full Content Template
Template Name: Thesis Details
*@file single-thesiss.php
*@package ahm
*@author Md Rabiul Islam Robin
*@copyright 2025
*@license
*@version 1.0
*@filesource ahm/single-thesiss.php
*@since ahm 1.0
*/
get_header();
?>
<?php
if (have_posts()):
while (have_posts()): the_post();
?>
<!-----------------------------------------------
Thesis Header
------------------------------------------------->
<section>
<div
class="breadcrumb-wrapper fix"
style="background-image: url(<?php echo get_template_directory_uri(); ?>/image/contact\ bg.jpg)"
id="contact-page">
<div class="star-shape-c float-bob-x">
<img src="image/star.png" alt="" />
</div>
<div class="container">
<div class="row">
<div class="page-heading">
<h2>
<?php echo get_post_meta($post->ID, 'wpcf-thesis-breadcrumb-heading', true); ?>
</h2>
<ul class="breadcrumb-list">
<li><a href="<?php echo home_url(); ?>">Home</a></li>
<li><a href=""><i class="fa-solid fa-angle-right"></i></a></li>
<li><a href="<?php echo get_permalink(98); ?>">Thesis</a></li>
<li><i class="fa-solid fa-angle-right"></i></li>
<li><?php echo get_post_meta($post->ID, 'wpcf-thesis-breadcrumb-heading', true); ?></li>
</ul>
</div>
</div>
</div>
</div>
</section>
<!-----------------------------------------------
Thesis section
------------------------------------------------->
<section class="MS-thesis-wrapper">
<div class="c-details-section fix">
<div class="container">
<div class="details-header t-d-h">
<h2><?php echo get_post_meta($post->ID, 'wpcf-thesis-page-heading', true); ?></h2>
</div>
</div>
</div>
<div class="thesis-details-wrapper">
<div class="container">
<div class="student-thesis-info">
<?php
$child_posts = toolset_get_related_posts(
$post->ID,
'thesis-student',
array(
'query_by_role' => 'parent',
'return' => 'post_object'
)
);
$posts_per_page = 15;
$total_posts = count($child_posts);
$total_pages = ceil($total_posts / $posts_per_page);
$paged = isset($_GET['pg']) ? intval($_GET['pg']) : 1;
if ($paged < 1) $paged = 1;
if ($paged > $total_pages) $paged = $total_pages;
$offset = ($paged - 1) * $posts_per_page;
$paged_posts = array_slice($child_posts, $offset, $posts_per_page);
if ($paged_posts) {
foreach ($paged_posts as $item) {
?>
<div class="thesis-item">
<div class="thesis-serial"><?php echo get_post_meta($item->ID, 'wpcf-serial', true); ?></div>
<div class="thesis-content-part">
<div class="row d-md-flex justify-content-between align-items-center">
<div class="col-md-4">
<div class="name-bar">
<h6><?php echo get_post_meta($item->ID, 'wpcf-t-student-name', true); ?></h6>
<p>Reg- <span><?php echo get_post_meta($item->ID, 'wpcf-registration-id', true); ?></span></p>
</div>
</div>
<div class="col-md-8">
<div class="title-bar">
<p><?php echo get_post_meta($item->ID, 'wpcf-thesis-title-s', true); ?></p>
</div>
</div>
</div>
</div>
<div class="session-bar">Session: <span><?php echo get_post_meta($item->ID, 'wpcf-t-session', true); ?></span></div>
</div>
<?php
}
} else {
echo '<p>No items found.</p>';
}
?>
<?php if ($total_pages > 1): ?>
<div class="pro-pagination" style="margin-top:40px; ">
<ul>
<?php if ($paged > 1): ?>
<li><a href="?pg=<?php echo $paged - 1; ?>"><i class="fa-solid fa-arrow-left"></i></a></li>
<?php endif; ?>
<?php for ($i = 1; $i <= $total_pages; $i++): ?>
<li class="<?php echo ($i == $paged) ? 'active' : ''; ?>">
<a href="?pg=<?php echo $i; ?>"><?php echo $i; ?></a>
</li>
<?php endfor; ?>
<?php if ($paged < $total_pages): ?>
<li><a href="?pg=<?php echo $paged + 1; ?>"><i class="fa-solid fa-arrow-right"></i></a></li>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>
</div>
</div>
</div>
</section>
<?php
endwhile;
endif;
?>
<?php get_footer(); ?>