• Resolved chansencc

    (@chansencc)


    Ok, so I have experimented, checked the forum, experimented some more, etc. Now I have to ask the question…

    So I am trying to use a full width page template (which I have) for a specific post category.

    Take a look here –
    https://www.nhcchurch.org/?p=254
    https://www.nhcchurch.org/?cat=15

    I removed the sidebar from the single-post category but the page content width needs to be widened as well… only when looking at the category and when looking at a single post within that category.

    I used this to remove the sidebar (sidebar.php) –

    <?php if(is_single(is_category (’15’))){}else{ ?>
    <?php } ?>

    And I was hoping this would work to widen the post area for the single post (added to page.php), but I was wrong.

    <?php if (is_single(is_category(’15’)) ?>
    function get_template(page_fullwidth.php)
    else {

    I am way too new at this. I would eventually like to make it so that it is a wide area with no sidebar when you look at the category, and when you look at a single post within that category. Any suggestions?

    Oh, and what is the correct way to add something like “and”? After I removed the sidebar from the single post, I couldn’t remove it from the category. My brain = remove sidebar from single() and category()

    Thanks to everyone who got through all that!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter chansencc

    (@chansencc)

    So I did some more tinkering and I was able to widen the area two different ways. Unfortunately, the conditional statements aren’t being very conditional.

    Within index.php (because I don’t have a single.php file) I used:

    <?php
    if (is_category(’15’))
    {
    echo ‘<div id=”contentwide”>’;
    } else {
    echo ‘<div id=”contentleft”>’;
    }
    ?>

    <?php

    if (is_category(’15’))
    {

    echo ‘<div class=”postareawide”>’;
    } else {
    echo ‘<div id=”postarea”>’;
    }
    ?>

    sorry if this is a dumb question… I’m pretty lost.

    Thread Starter chansencc

    (@chansencc)

    Nevermind. I finally figured it out.

    So how did you do it? Can you share it?

    This is my page.php

    I can remove the sidebar but there is a lot of space. The right column still occupies space. How can I make it full width by really removing the right side?

    Thanks!

    <?php get_header(); ?>
    
    	<div class="wrap background">
    
    		<div id="content" class="left-col wrap">
    
    		<?php if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
    
    		<!--- Post Starts -->
    
    			<div class="post wrap page">
    
    				<div class="post-content right-col">
    					<h2><?php the_title(); ?></h2>
    					<?php the_content(); ?>	
    
    					<?php endwhile; ?>
    
    					<?php endif; ?>
    
    					<?php comments_template(); ?>
    
    				</div>
    
    			</div>
    
    			<!--- Post Ends -->
    
    		</div>
    
    		<?php get_sidebar(); ?>
    
    	</div>
    
    </div>
    
    <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Full width template for specific post category’ is closed to new replies.