<?php /* Template Name: archive */ ?> <?php get_header(); ?><!-- inner banner-wrapper end -->' . get_the_date() . '' ); elseif ( is_month() ) : printf( __( 'MONTHLY NEWS ARCHIVES: %s', 'twentytwelve' ), '' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '' ); elseif ( is_year() ) : printf( __( 'YEARLY NEWS ARCHIVES: %s', 'twentytwelve' ), '' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '' ); else : _e( 'LATEST NEWS ARCHIVES', 'twentytwelve' ); endif; ?>
single post else'; } if (have_posts()) : while (have_posts()): the_post(); ?> <!-- news unit end --> <?php endwhile; else: ?> <p><?php _e('Sorry, no records matched your criteria.'); ?></p> <?php endif; wp_reset_query(); ?> </div><!-- right content end --> <!-- SIDEBAR WARAPPER END --><!-- common-text-area end --> </div><!-- inner end --> </div><!-- inner-content-wrapper end --> </div><!-- content-wrapper end --> <?php get_footer(); ?>Using the Loop
06 Thursday Feb 2014
Posted css, General Resources, Inspiration, jquery / javascript, jQuery Plugins, Learning, Other Tools, php, wordpress dev, wp plugins
inThe Loop should be placed in index.php and in any other Templates used to display post information.
Be sure to include the call for the header template at the top of your Theme‘s templates. If you are using The Loop inside your own design (and your own design is not a template), set WP_USE_THEMES to false:
<?php define('WP_USE_THEMES', false); get_header(); ?>The loop starts here:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>and ends here:
<?php endwhile; else: ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?></p> <?php endif; ?>This is using PHP’s alternative syntax for control structures, and could also be expressed as:
<?php if ( have_posts() ) { while ( have_posts() ) { the_post(); // // Post Content here // } // end while } // end if ?>
WordPress Blog Archive Template with Pagination
05 Thursday May 2016
Posted Wordpress Archive/ Blog, wordpress dev
in