Columns not displaying in replicated blog posts page

  • Author
    Posts
  • #28948
    Tracy

    I am in the process of creating a new page for a custom post type and am having some troubles replicating the Tempera Blog page template.

    I have my custom post types and fields displaying but they are displaying all in one column. I would like the page to be virtually identical to the existing Tempera blog page, which means having the posts display in two columns.

    Does anyone have any suggestions on how to get my new custom post (blog) template displaying these columns?

    Here is a link to the page using the Tempera Blog page template. This is the page I’d like to replicate.
    http://yachtandwaterfront.com/category/yacht-and-waterfront-news-articles/

    Here is a link to the page I am creating that is currently not displaying the two columns.
    http://yachtandwaterfront.com/boat-shows/boat-show-database

    This is the code I have for my custom post type page template.

    ?php /*

    * Template Name: Boat Show Database-EDIT

    *

    * @package Cryout Creations

    * @subpackage tempera

    * @since tempera 0.5

    */

    get_header(); ?>

    <section id=”container” class=”magazine-layout”>

    <div id=”content” role=”main”>

    <?php cryout_before_content_hook(); ?>

    <?php $loop = new WP_Query( array( ‘post_type’ => ‘bs_posts’) ); ?>

    <?php while ( $loop->have_posts() ) : $loop->the_post();

    global $more; $more=0;

    get_template_part( ‘content/content’, get_post_format() );

    endwhile; ?>

    <?php cryout_after_content_hook(); ?>

    </div><!– main –>

    </section><!– #container –>

    #28978
    Tracy

    I understand this has something to do with float and that it is not applying to my custom post types for some reason. I assume this is because posts are renamed at somepoint in the tempera code but I can not find the location to add my custom post type to whatever loop has been engineered here. If anyone has some ideas on a quick work around to get the float to apply it would really make my day!!

    I have changed my page template, it now is a direct reflection of the blog template, minus the get_option and $paged which seems to draw out the regular posts and none of the custom posts.

    Here is my current page template.

    <?php /*

    Template Name: Boat Show

    */ ?>

    <?php get_header(); ?>

    <section id=”container” class=”<?php echo tempera_get_layout_class(); ?>”>

    <div id=”content” role=”main”>

    <?php cryout_before_content_hook(); ?>

    <div class=”container”>

    <?php

    $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;

    $the_query = new WP_Query( array( ‘post_type’ => ‘bs_posts’) );?>

    <?php if ( $the_query->have_posts() ) :

    /* Start the Loop */

    while ( $the_query->have_posts() ) : $the_query->the_post();

    global $more; $more=0;

    get_template_part( ‘content/content’, get_post_format() );

    endwhile;

    if($tempera_pagination==”Enable”) tempera_pagination($the_query->max_num_pages); else tempera_content_nav( ‘nav-below’ );

    else : ?>

    </div><!–container –>

    <article id=”post-0″ class=”post no-results not-found”>

    <header class=”entry-header”>

    <h1 class=”entry-title”><?php _e( ‘Nothing Found’, ‘tempera’ ); ?></h1>

    </header><!– .entry-header –>

    <div class=”entry-content”>

    <p><?php _e( ‘Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.’, ‘tempera’ ); ?></p>

    <?php get_search_form(); ?>

    </div><!– .entry-content –>

    </article><!– #post-0 –>

    <?php endif; ?>

    <?php cryout_after_content_hook(); ?>

    </div><!– #content –>

    <?php tempera_get_sidebar(); ?>

    </section><!– #container –>

    <?php get_footer(); ?>

    I have tried putting div class containers around code. Because I see the post meta is spanning the page and perhaps because this is not in the container is why the float is not working properly.

    Obviously this did not work.
    Can anyone PLEASE suggest a work around to get the float to work properly and the posts to display 2 across as they should.
    Please.

    #29099
    bpebble

    Ok.

    So for all the others out there that need to know how to solve this.

    I will tell you how to solve this because sure as ____ you won’t get help from anyone else on here!!

    Ok, so if you got as far as an active page displaying in one column.
    You are just shy of finishing the race.
    The fix is such an easy fix!

    Just to be certain…..
    You should already have a template-custompost.php, a content-custompost.php and a single-custompost.php.

    The last step to make this work is the word post!!

    In template-custompost.php
    Look for this line and insert ‘post’ within the empty brackets following get_post_format

    get_template_part( ‘content/content-custompost’, get_post_format(‘post’) );

    In content-custompost.php
    Look for this line and insert ‘post’ within the empty brackets following post_class

    <article id=”post-<?php the_ID(); ?>” <?php post_class( ‘post’); ?>>

    and In single-custompost.php
    (not sure if this one is necessary but it didn’t adversely affect my single post display so it’s in there)
    Look for this line and insert ‘post’ within the empty brackets following post_class

    <div id=”post-<?php the_ID(); ?>” <?php post_class( ‘post’); ?>>

    VOILA!!

    Custom Posts now display exactly as wp posts only on a different page and never the twain shall meet!

    🙂

    No thanks to anyone here!

    Best of luck and customizing to everyone else.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Columns not displaying in replicated blog posts page’ is closed to new replies.