[resolved] Full-width POST (3 posts)

  1. porcoazurro
    Posted 1 year ago #


    I am using the Origin child theme on my website http://przejezyczenie.com/. It is based off the version 0.2.9, which is available in WordPress.com theme repository, because with the latest version I had problems uploading the logo in the size I wanted (now the logo spreads through the whole page; before, it shrank to one third of it).

    My point is, I would like to have a full-width template for single posts, so that the sidebar was visible only anywhere else, like archives, blogfeed, homepage etc.

    I have installed Custom Post Template plugin.

    I thought I'd be clever and copied the full-wdith page template to my child theme's directory, replaced "page" with "post" in the filename, and combined the original code with the one available in "single.php". So now it reads like this:

     * Template Name: Full Width
     * @package Origin
    get_header(); // Loads the header.php template. ?>
    	<div id="content">
    		<div class="hfeed">
    			<?php if ( have_posts() ) : ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    					<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    						<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    						<div class="byline">
    							<abbr class="published" title="<?php echo get_the_date(); ?> <?php echo get_the_time(); ?>"><?php echo get_the_date(); ?></abbr> <?php _e( '·', 'origin' ); ?>
    							<?php _e( 'by', 'origin' ); ?> <span class="author vcard"><?php the_author_posts_link(); ?></span> <?php _e( '·', 'origin' ); ?>
    							<?php _e( 'in', 'origin' ); ?> <?php echo get_the_category_list( ', ' ); ?>
    							<span class="edit"><?php edit_post_link( __( 'Edit', 'origin' ), __( '·', 'origin' ) ); ?></span>
    						<div class="entry-content">
    							<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'origin' ) ); ?>
    							<?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'origin' ), 'after' => '</p>' ) ); ?>
    								$tags_list = get_the_tag_list( '', ', ' );
    								if ( $tags_list ):
    								<div class="byline">
    									<?php printf( __( '<span class="%1$s">Tags:</span> %2$s', 'origin' ), 'tags-label', $tags_list ); ?>
    							<?php endif; ?>
    						</div><!-- .entry-content -->
    						<div class="entry-meta">
    							<span class="edit"><?php edit_post_link( __( 'Edit', 'origin' ) ); ?></span>
    					</div><!-- .hentry -->
    					<?php get_sidebar( 'after-singular' ); // Loads the sidebar-after-singular.php template. ?>
    					<?php comments_template(); // Loads the comments.php template. ?>
    				<?php endwhile; ?>
    			<?php endif; ?>
    		</div><!-- .hfeed -->
    		<?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
    	</div><!-- #content -->
    <?php get_footer(); // Loads the footer.php template. ?>

    But it's not working.

    Here's how a post looks with this template on:

    Here's how I would like it to look:
    http://przejezyczenie.com/kontakt/ (this is an example of a full-width page)

    Hope somebody can help me.

  2. porcoazurro
    Posted 1 year ago #

    I got this.

    I threw Custom Post Templates out the window and added this to style.css through trial and error:

    .single #sidebar-primary {
    	display: none;
    .single #content {
    	width: 100%;

    Works like a charm.

  3. porcoazurro
    Posted 1 year ago #

    Gotta love to code.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic