Home  >  Article  >  CMS Tutorial  >  How to make a wordpress news list

How to make a wordpress news list

藏色散人
藏色散人Original
2019-07-16 09:38:414546browse

How to make a wordpress news list

How to make a wordpress news list

WordPress news article list page imitation site steps

1 , Make archive.php page

2. Call the header, sidebar, and footer files

Call the header tag:

<?php get_header();?>

Call the bottom tag:

<?php get_footer();?>

Call the sidebar tag:

<?php get_sidebar();?>

3. Call the article in a loop

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php endwhile; ?>
<?php endif; ?>

Title call:

<a href="<?php the_permalink() ?>"> <?php echo mb_strimwidth(get_the_title(), 0, 32, &#39;&#39;); ?></a>

Date call:

<?php the_date_xml()?>

Page name call:

<?php wp_title(&#39;&#39;);?>

4. Pagination call

<?php kriesi_pagination($query_string); ?>

For more WordPress technical articles, please visit the WordPress Tutorial column!

The above is the detailed content of How to make a wordpress news list. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn