• Hey, I’m currently using a free wordpress theme Seller, and I want to change the home page’s display function. Here is the original code:

    <main id="main" class="site-main" role="main">
    		<?php $count = 0; ?>
    		<?php if ( have_posts() ) : ?>
    
    			<?php /* Start the Loop */ ?>
    			<?php while ( have_posts() ) : the_post(); ?>
    
    				<?php
    					/* Include the Post-Format-specific template for the content.
    					 * If you want to override this in a child theme, then include a file
    					 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    					 */
    					if($count == 0)
    						echo "<div class='row'>" ;
    					elseif($count%4 == 0)
    						echo "</div><!--.row--><div class='row'>";
    
    					if (isset($option_setting['logo'])) :
    						get_template_part( 'content', 'grid3' );
    					else :
    						get_template_part( 'defaults/content', 'grid3-d' );
    					endif;
    
    					$count++;
    				?>
    			<?php endwhile; ?>
    			<?php echo "</div><!--.row-->"; ?>
    
    			<?php seller_pagination(); ?>
    
    		<?php else : ?>
    
    			<?php get_template_part( 'content', 'none' ); ?>
    
    		<?php endif; ?>
    
    		</main>

    Now, I am trying to change this function so that instead of displaying the recent posts, I want to make something like “editor’s choice” or “recommended reading”, and those displays are going to be pages, and static, not posts. I understand the original code and which part to change, but not sure to change it to what. I have read some articles about page_id, is this the right way to approach? Any idea would be very helpful!

The topic ‘Help with home.php’ is closed to new replies.