Support » Fixing WordPress » loop.php and custom template

  • If i set the blog page in the admin panal to the page i made called blog then i see it uses the loop.php file and works no problem, however if i make a copy of the code in loop.php and paste it to the blog.php file it doesnt work.

    am i supposed to change it somewhere else for it to work? how do i make a custom page work for blogging?

    im using the HTML5 Blank theme and the loop.php code is:

    <?php if (have_posts()): while (have_posts()) : the_post(); ?>
    
    	<!-- article -->
    	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    		<!-- post thumbnail -->
    		<?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
    			<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    				<?php the_post_thumbnail(array(120,120)); // Declare pixel size you need inside the array ?>
    			</a>
    		<?php endif; ?>
    		<!-- /post thumbnail -->
    
    		<!-- post title -->
    		<h2>
    			<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    		</h2>
    		<!-- /post title -->
    
    		<!-- post details -->
    		<span class="date"><?php the_time('F j, Y'); ?> <?php the_time('g:i a'); ?></span>
    		<span class="author"><?php _e( 'Published by', 'html5blank' ); ?> <?php the_author_posts_link(); ?></span>
    		<span class="comments"><?php comments_popup_link( __( 'Leave your thoughts', 'html5blank' ), __( '1 Comment', 'html5blank' ), __( '% Comments', 'html5blank' )); ?></span>
    		<!-- /post details -->
    
    		<?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?>
    
    		<?php edit_post_link(); ?>
    
    	</article>
    	<!-- /article -->
    
    <?php endwhile; ?>
    
    <?php else: ?>
    
    	<!-- article -->
    	<article>
    		<h2><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h2>
    	</article>
    	<!-- /article -->
    
    <?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘loop.php and custom template’ is closed to new replies.