Hi, I have created my custom post type template and all works fine.
So, I would like to change the page layout for this custom post type. The code inside wp-single-{my-custom-post-type}.php is this:
<?php
// =============================================================================
// VIEWS/RENEW/WP-SINGLE-PROGETTI.PHP
// -----------------------------------------------------------------------------
// Single custom post Progetti output for Renew.
// =============================================================================
$fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );
get_header();
?>
<div class="x-container max width offset">
<div class="<?php x_main_content_class(); ?>" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php x_get_view( 'renew', 'content', get_post_format() ); ?>
<?php endwhile; ?>
</div>
<?php if ( $fullwidth != 'on' ) : ?>
<?php get_sidebar(); ?>
<?php endif; ?>
</div>
<?php get_footer(); ?>
Before Footer there’s an if statement that said if fullwidth is off, then get sidebar. And at the top there a declaration of $fullwidth
. So, it is a variable. How can I set fullwidth to on, excluding in this way the sidebar?
Thank you very much