Home › Forums › ASE Support › Kerouac Home Page configuration options
Tagged: Home page., kerouac
- This topic has 1 reply, 2 voices, and was last updated 4 years, 10 months ago by
Hyun Supul.
-
AuthorPosts
-
Participant
We don’t know how to configure this to show more than 10 stories. It now shows four posts per row. How do we expand the number of posts?
KeymasterHi Terry,
Currently Kerouac doesn’t support changing this option from the customization menu. But it can be changed by making changes to the PHP codes. I suggest you make a child theme if you want to change this.Basically you need to make a few modifications to front-page.php and content-indexstory.php. They are found under wp-content\themes\kerouac
Here are sample front-page.php and content-indexstory.php that are modified to display six stories in each row. If you diff them with the files you have, you will notice there are relatively few differences, mainly some numbers.
front-page.php:
<?php /* Template Name: All Stories */ get_header(); query_posts( 'posts_per_page=12' ); ?><main class="kerouac-story-collection kerouac-home-collection kerouac-content"> <div class="clearfix kerouac-collection-row "> <?php $index = 0; if ( have_posts() ) : while ( have_posts() ) : the_post(); $index++; $count = 12; get_template_part( 'content', 'indexstory' ); if ( ( 0 == $index % 6 ) && ( $index < $count )) { printf('</div><div class="clearfix kerouac-collection-row">'); } endwhile; else : get_template_part( 'content', 'none' ); endif; ?> </div> </main> <?php get_footer();
content-indexstory.php
<?php $coverimg = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID() ), 'kerouac-square-cover' ); $category = get_the_category(); if (get_the_category()) { $firstCategory = $category[0]->cat_name; } else { $firstCategory = ''; } ?> <div class="kerouac-collection-item col-md-2"> <a href="<?php echo the_permalink();?>" class="kerouac-collection-item-link"> <div class="kerouac-collection-item-inner"> <div class="kerouac-collection-item-img" style="background-image:url(<?php echo $coverimg[0];?>);background-repeat:no-repeat;background-size:cover;"></div> <?php the_title('<h3 class="kerouac-collection-entry-title">','</h3>');?> <p class="kerouac-collection-meta">By <span><?php echo get_the_author();?></span> in <span><?php echo $firstCategory;?></span> <div class="kerouac-collection-item-excerpt"><?php echo wp_trim_words(get_the_excerpt(),8,'...');?></div> <span class="kerouac-collection-read-more"><?php echo apply_filters('kerouac_readmore_text', _e('Read More','kerouac'));?></span> </div> </a> </div>
-
This reply was modified 4 years, 10 months ago by
Hyun Supul.
-
This reply was modified 4 years, 10 months ago by
Hyun Supul.
-
This reply was modified 4 years, 10 months ago by
Hyun Supul.
-
This reply was modified 4 years, 10 months ago by
-
AuthorPosts