Current File : /var/www/html/blog/wp-content/themes/amadeus/single-custom-layout.php
<?php
/**
 * Template Name: Custom Result-Driven Layout
 * Template Post Type: post
 */

// ===================================================================
// 1. GET EXISTING HEADER
// ===================================================================
get_header(); 
?>

<div class="page-container">
    
    <!-- ==== LEFT COLUMN: ARTICLE ==== -->
    <article class="blog-article">

        <?php 
        if ( have_posts() ) : while ( have_posts() ) : the_post(); 
        ?>

        <!-- ZONE 1: THE HOOK (Our Custom Hero Section) -->
        <section class="hero-section">
            <div class="category-tag"><?php the_category(', '); ?></div>
            <h1 class="entry-title"><?php the_title(); ?></h1>
            <div class="author-meta">
                <?php echo get_avatar( get_the_author_meta('ID'), 50, '', 'Author headshot', ['class' => 'author-image'] ); ?>
                <div class="meta-text">
                    By <strong><?php the_author(); ?></strong> <br>
                    Published on <?php echo get_the_date(); ?>
                </div>
            </div>
            <?php if ( has_post_thumbnail() ) : ?>
                <?php the_post_thumbnail('large', ['class' => 'hero-image']); ?>
            <?php endif; ?>
        </section>

        <!-- ZONE 2: THE CONTENT (Your Post Content) -->
        <section class="main-article">
            <?php the_content(); ?>
        </section>

<section class="full-width-cta">
    <div class="cta-content">
        <h2>Powering Your Operations, Guaranteed.</h2>
        <p>Downtime is not an option. Our industrial power solutions are engineered for maximum uptime and reliability. Ensure your critical systems are always online.</p>
        <a href="tel:+91 98860 81610" class="cta-button">Speak to an Engineer</a>
    </div>
</section>

        <!-- ZONE 3: THE NEXT STEP (Author Bio, etc.) -->
        <section class="author-bio-section">
            <?php echo get_avatar( get_the_author_meta('ID'), 100, '', 'Author headshot', ['class' => 'author-image-large'] ); ?>
           <!-- <img src="https://digitifyou.com/blog/wp-content/uploads/2025/09/1756894311573.jpg" alt="Alagar-Raja-Digitifyu">-->
            <div class="author-bio-text">
                <h4>About <?php the_author(); ?></h4>
                <p><?php the_author_meta( 'description' ); ?></p>
            </div>
        </section>

        <!-- NEW: NEXT & PREVIOUS POST NAVIGATION -->
        <nav class="post-navigation-section" aria-label="Posts">
            <?php the_post_navigation( array(
                'prev_text' => '<span class="nav-arrow">&larr;</span> Previous Post',
                'next_text' => 'Next Post <span class="nav-arrow">&rarr;</span>',
            ) ); ?>
        </nav>

        

        <?php 
        endwhile; endif; 
        ?>

    </article>

    
    <div class="sidebar-sticky">
<?php
       get_sidebar(); 
  ?>
    </div>
  

</div> <!-- End of .page-container -->

<div> 
 <!-- NEW: RELATED POSTS SECTION -->
        <section class="related-posts-section">
            <h3 class="section-title">Related Articles</h3>
            <div class="related-posts-grid">
                <?php
                $categories = get_the_category($post->ID);
                if ($categories) {
                    $category_ids = array();
                    foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
                    $args = array(
                        'category__in' => $category_ids,
                        'post__not_in' => array($post->ID),
                        'posts_per_page' => 4, // Show 2 related posts
                        'ignore_sticky_posts' => 1
                    );
                    $related_query = new wp_query( $args );
                    if( $related_query->have_posts() ) {
                        while( $related_query->have_posts() ) {
                            $related_query->the_post();
                            ?>
                            <a href="<?php the_permalink(); ?>" class="related-card">
                                <?php if ( has_post_thumbnail() ) : ?>
                                    <?php the_post_thumbnail('medium_large', ['class' => 'related-card-image']); ?>
                                <?php else: ?>
                                    <img src="https://placehold.co/400x250/EFEFEF/333333?text=VERTEX BLOG" alt="Placeholder image" class="related-card-image">
                                <?php endif; ?>
                                <div class="related-card-content">
                                    <h4><?php the_title(); ?></h4>
                                </div>
                            </a>
                            <?php
                        }
                    }
                    wp_reset_postdata();
                }
                ?>
            </div>
        </section>
<!-- NEW: FULL-WIDTH CTA SECTION -->
<section class="full-width-cta">
    <div class="cta-content">
        <h2>Standard Solutions Don't Fit Your Project?</h2>
        <p>Your application has unique power demands. We specialize in designing and manufacturing customized battery and power solutions tailored to your exact technical specifications.</p>
        <a href="http://vertexpower.co.in/vertex-contact-us.php" class="cta-button">Get a Custom Quote</a>
    </div>
</section>
</div>

<?php
// ===================================================================
// 3. GET EXISTING FOOTER
// ===================================================================
get_footer(); 
?>