HEX
HEX
Server: Apache
System: Linux localhost.localdomain 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64
User: www (1001)
PHP: 8.1.32
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
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(); ?>