Support » Fixing WordPress » loop.php and custom template

  • Nicholas Ritson


    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 ?>
    		<?php endif; ?>
    		<!-- /post thumbnail -->
    		<!-- post title -->
    			<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    		<!-- /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 -->
    <?php endwhile; ?>
    <?php else: ?>
    	<!-- article -->
    		<h2><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h2>
    	<!-- /article -->
    <?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi


    Your main posts page uses the index.php template file in your theme – irrespective of what custom page template you might try to use.

    Nicholas Ritson


    thanks took a look at that now, just gotta style the whole thing should be easy from now. much appreciated for the fast, accurate reply.



    No problem 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘loop.php and custom template’ is closed to new replies.