Wordpress Theme: Home

Another file is created for the home page to reserve different content and presentation for it. However, it differs little from the article page.

Page structure

It differs from the article page in that it has a loop for displaying the summary list and the internal components that are selected for display, even though most are common to the part page.

Headers, footers, and sidebars are identical.

Global page

<html>
<head></head>
<body>

<?php get_header(); ?>

<h1> 
<?php 
if (is_home()) bloginfo('name');
elseif (is_category()) single_cat_title();
elseif (is_search()) bloginfo('name');
else wp_title('',true);
?> </h1> <?php while ( have_posts() ) : the_post() ?> <div id="<?php the_ID() ?>" class="excerpt"> <h2><a href="<?php the_permalink() ?>"> <?php the_title() ?></a></h2> <div class="content"> <?php the_content('<span class="more">'.__('More...', '').'</span>'); ?> </div> </div> <?php wp_link_pages(); ?> <?php endwhile ?> <?php get_sidebar() ?> <?php get_footer(); ?> </body> </html>

Depending on the context, the site name, category, and search subject are displayed. This is an option that can be removed if considered useless. You can only show the category:

<h1> 
   <?php if(is_category()) single_cat_title(); ?>
</h1> 

A looped call to the the_post () function displays the contents of the latest tickets, or a summary, if defined, or the beginning of the article before the <! -more -> if inserted in article code.

The use of the ticket ID as the data block ID may be further used.

A summary title is created along with the article title and link to access the article. It is in the h2 tag, as there are several headers on the home page.

It was decided to insert the More button to show the continuation, but this duplicates the link in the header, so you can delete it and leave the the_content () function without the parameter .

Article List Details

Article components:

<h2><a href="<?php the_permalink() ?>"> <?php the_title() ?></a></h2>
<?php
 the_content();
 the_author_link();
 the_date();
 the_category(', ');
 the_tags();
 edit_post_link();
 if (comments_open()) 
{
      comments_popup_link(
__('A comment?', ''),
__('1 comment', ''),
__('% comments', ''),
'comments-link',
'Shuttt'); } ?>

It also displays an edit command, which not all themes do and this is incorrect. Recall that it is shown only to authors.

The comment block contains useful settings on the home page that are not on the articles page. In order:

Useful documentation

The page can use article components and database access widgets.