Ready to get started?Download WordPress


Hatch Theme separate posting / blog page (3 posts)

  1. stonk
    Posted 1 year ago #

    Hi there,
    I need to add a page that acts like the home page for the page that links from the side projects heading in the navigation menu. I need comments to be available and my posts or "side projects" to act like posts within that page? I dont want the home page to change its appearance at all though? Sorry if I am not making myself very clear.
    Basically another post page under the heading Side Projects.
    Is there a way to do this reasonably easily?


  2. stonk
    Posted 1 year ago #

    site link is stonk.net

  3. stoatoffear
    Posted 1 year ago #

    Another posts page displaying "side projects"?

    Create a category of "side_projects"
    Give your chosen posts this category.
    Create a new post type "side projects"
    Switch your chosen posts to this post type (post-type switcher module is good for this)

    Then create a template file in your child-theme folder called "side-projects". Give it a loop which will display side_projects category posts OR side-project post-types.
    (If you have a new post-type you will have to create a template to display individual posts of that as well)
    This should work as the loop for your side-projects template (assuming by now you have a category called side_projects and some posts with that category):

    <div class="hfeed">
    			<h4>Side Projects</h4>
    			<?php $loop = new WP_Query( 'category_name=side_projects' ); ?>
    			<?php if ( $loop->have_posts() ) : ?>
    				<?php $counter = 1; ?>
    				<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    						<?php do_atomic( 'before_entry' ); // hatch_before_entry ?>
    						<?php if ( ( $counter % 4 ) == 0 ) { ?>
    							<div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?> last">
    						<?php } else { ?>
    							<div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
    						<?php } ?>													
    								<?php do_atomic( 'open_entry' ); // hatch_open_entry ?>
    								<?php if ( current_theme_supports( 'get-the-image' ) ) {
    									get_the_image( array( 'meta_key' => 'Thumbnail', 'size' => 'archive-thumbnail', 'image_class' => 'featured', 'width' => 220, 'height' => 150, 'default_image' => get_template_directory_uri() . '/images/archive_image_placeholder.png' ) );
    								} ?>					
    								<?php echo apply_atomic_shortcode( 'entry_title', '[entry-title]' ); ?>						
    								<?php do_atomic( 'close_entry' ); // hatch_close_entry ?>							
    							</div><!-- .hentry -->
    						<?php do_atomic( 'after_entry' ); // hatch_after_entry ?>
    					<?php $counter++; ?>
    				<?php endwhile; ?>
    			<?php else : ?>
    				<?php get_template_part( 'loop-error' ); // Loads the loop-error.php template. ?>
    			<?php endif; ?>
    		</div><!-- .hfeed -->

    Create a new page called "side-projects" select the side-projects template from the "templates" dialog.

    Write some css


    This is helpful:

Topic Closed

This topic has been closed to new replies.

About this Topic