HEX
Server: nginx/1.18.0
System: Linux vcwordpress 5.15.0-174-generic #184-Ubuntu SMP Fri Mar 13 18:41:50 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/laracopilot.stgviitor.com/laracopilot-wp/wp-content/themes/laracopilot-v2/page.php
<?php

/**
 * The template for displaying all pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site may use a
 * different template.
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package LaraCopilot_V2
 */

get_header();
?>

<main id="primary" class="site-main">

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

        // Detect if this is a LaraCopilot Marketplace page
        $content = get_the_content();
        $is_lcm_page = false;
        $lcm_shortcodes = [
            'lcm_registration_form',
            'lcm_directory',
            'lcm_profile',
            'lcm_dashboard',
            'lcm_enquiry_form'
        ];

        foreach ($lcm_shortcodes as $shortcode) {
            if (has_shortcode($content, $shortcode)) {
                $is_lcm_page = true;
                break;
            }
        }

        // Also check against plugin settings for robustness
        $lcm_settings = get_option('lcm_settings', []);
        $lcm_pages = [
            (int) ($lcm_settings['marketplace_page_id'] ?? 0),
            (int) ($lcm_settings['dashboard_page_id']   ?? 0)
        ];

        if (in_array(get_the_ID(), $lcm_pages, true)) {
            $is_lcm_page = true;
        }

        // CMS Page Detection
        $cms_slugs = array('privacy-policy', 'terms', 'security', 'cookie-policy');
        $is_cms_page = is_page($cms_slugs);

        if ($is_lcm_page) {
            // Render marketplace content directly for a clean, full-width layout
            echo '<div class="lcm-clean-page-wrapper">';
            the_content();
            echo '</div>';
        } elseif ($is_cms_page) {
            // Professional CMS layout
            echo '<div class="cms-container">';
            the_content();
            echo '</div>';
        } else {
            // Standard theme rendering
            get_template_part('template-parts/content', 'page');
        }

        // If comments are open or we have at least one comment, load up the comment template.
        if (! $is_lcm_page && (comments_open() || get_comments_number())) :
            comments_template();
        endif;

    endwhile; // End of the loop.
    ?>

</main><!-- #main -->

<?php
if ((! isset($is_lcm_page) || ! $is_lcm_page) && (! isset($is_cms_page) || ! $is_cms_page)) {
    get_sidebar();
}
get_footer();