WordPress.org

Ready to get started?Download WordPress

Forums

Can't get excerpts in Hatch theme :-( (9 posts)

  1. remcosieb
    Member
    Posted 1 year ago #

    Hello,

    I am trying to change the hatch theme. It goes pretty well but i cant get the excerpts showing underneath the post thumbnails on my homepage. Like shown on this site:
    http://ilanserruya.com/
    I saw at this forum he uses the hatch theme to. Well i hope anyone can help me cos it took me a full day with no result jet...
    Thanks

    Remco

  2. Sergio Vasco
    Member
    Posted 1 year ago #

    For excerpts, you can use <?php the_excerpt(); ?> instead of <?php the_content(); ?> in your template files. For homepage, you may need to change index.php or home.php.

    I just checked out the website you posted. They are not using hatch theme. They are using the gridlocked theme - http://www.themezilla.com/themes/gridlocked/

  3. remcosieb
    Member
    Posted 1 year ago #

    Thanks for your quick answer. But i already tried that today. It just doesnt show the excerpts that i typed i the posts.. Is it possible that some mind of container is blocking the possibility to show it on the home screen?

  4. remcosieb
    Member
    Posted 1 year ago #

    I still won't get my site work. There is no such thing as the_content in my home or index.php.. Any help?

  5. Shail
    Member
    Posted 1 year ago #

    You can use below code instead of the_content().

    It returns first 100 charecter from your content.

    substr(get_the_content(), 0, 100);

    May this help.

  6. remcosieb
    Member
    Posted 1 year ago #

    Thanks for your answer but where do i put that? I can't find the_concent in index.php or home.php...
    this is the code:

    <?php
    /**
     * Home Template
     *
     * A custom home page template.
     *
     * @package Hatch
     * @subpackage Template
     */
    
    get_header(); // Loads the header.php template. ?>
    
    	<?php do_atomic( 'before_masthead' ); // hatch_before_masthead ?>
    
    	<div id="masthead">
    
    		<?php do_atomic( 'open_masthead' ); // hatch_open_masthead ?>
    
    		<?php $hatch_author_bio = hybrid_get_setting( 'hatch_author_bio' ) ? hybrid_get_setting( 'hatch_author_bio' ) : '1'; ?>
    
    		<div id="author-bio"><?php the_author_meta( 'description', $hatch_author_bio ); ?></div>
    
    		<div id="header-banner" role="banner">
    
    			<?php // Check to see if the header image has been removed
    			$header_image = get_header_image();
    
    			if ( ! empty( $header_image ) ) : ?>
    
    				<img src="<?php header_image(); ?>" alt="" />
    
    			<?php endif; // end check for removed header image ?>
    
    		</div>
    
    		<?php do_atomic( 'close_masthead' ); // hatch_close_masthead ?>
    
    	</div>
    
    	<?php do_atomic( 'before_content' ); // hatch_before_content ?>	
    
    	<div id="content">
    
    		<?php do_atomic( 'open_content' ); // hatch_open_content ?>
    
    		<div class="hfeed">
    
    			<?php if ( have_posts() ) : ?>
    
    				<?php $counter = 1; ?>
    
    				<?php while ( have_posts() ) : 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' => 400, 'height' => 113, '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 -->
    
    		<?php do_atomic( 'close_content' ); // hatch_close_content ?>
    
    		<?php get_template_part( 'loop-nav' ); // Loads the loop-nav.php template. ?>
    
    	</div><!-- #content -->
    
    	<?php do_atomic( 'after_content' ); // hatch_after_content ?>
    
    <?php get_footer(); // Loads the footer.php template. ?>
  7. Shail
    Member
    Posted 1 year ago #

    You can paste any where in while loop. as you required it doesnt matter the_content() is available or not...

  8. remcosieb
    Member
    Posted 1 year ago #

    thanks!! that finally worked!!

  9. Shail
    Member
    Posted 1 year ago #

    :)

Topic Closed

This topic has been closed to new replies.

About this Topic