Skip to content

Instantly share code, notes, and snippets.

@ivanteoh
Created July 5, 2020 03:51
Show Gist options
  • Select an option

  • Save ivanteoh/cb0e88bf90213ba9adcf8de9b8c436d4 to your computer and use it in GitHub Desktop.

Select an option

Save ivanteoh/cb0e88bf90213ba9adcf8de9b8c436d4 to your computer and use it in GitHub Desktop.
WordPress Theme Development 2 - Minimum Main Index Template
<?php
/**
* @package WordPress
* @subpackage Your_Theme
*/
get_header(); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : ?>
<?php the_post(); ?>
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark"
title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?></a></h2>
<?php the_content(__('Read more...')); ?>
<p><?php wp_link_pages(); ?></p>
<p><?php _e('Posted by'); ?> <?php the_author(); ?> @
<?php the_time('F jS, Y'); ?> <?php _e('in'); ?>
<?php the_category(','); ?> <?php the_tags(__('with '), ', '); ?></p>
<p><?php comments_popup_link(__('No Comments &#187;'),
__('1 Comment &#187;'), __('% Comments &#187;')); ?>
<?php edit_post_link(__('Edit This'), '&#8212;'); ?></p>
</div>
<?php comments_template(); ?>
<?php endwhile; ?>
<p><?php next_posts_link(__('&laquo; Older Posts')); ?></p>
<p><?php previous_posts_link(__('Newer Posts &raquo;')); ?></p>
<?php else : ?>
<h2><?php _e('Not Found'); ?></h2>
<p><?php _e('Sorry, but you are looking for something that isn&#39;t here.'); ?>
</p>
<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post();
the_content();
endwhile;
endif;
get_sidebar();
get_footer();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment