Typecho How to page pagination and article pagination

Source: Internet
Author: User
Because often write longer articles so in order to beautiful need to page, is the first page preview only display the specified part of the content, but it is very unfortunate only fixed to modify index.php let each article show fixed number of words, how to set how much each article shows how many ... The second is the homepage of the article list how to page display ... Because the number of articles is relatively large.

Reply content:

Because often write longer articles so in order to beautiful need to page, is the first page preview only display the specified part of the content, but it is very unfortunate only fixed to modify index.php let each article show fixed number of words, how to set how much each article shows how many ... The second is the homepage of the article list how to page display ... Because the number of articles is relatively large.

You can use custom fields, and then the home page uses custom fields to display what you want to display, see: Http://docs.typecho.org/help/custom-fields

In addition, the homepage of the article should be a normal page, background settings can be set to show how many articles per page.

If you need some advanced paging features, such as first page 20, search page 40, then consider modifying functions.php

For example, modify the default pagesize to 20.

function themeInit($archive) {    if ($archive->is('index')) {        $archive->parameter->pageSize = 20; // 自定义条数    }}

The effect is that the number of articles per page in the home page is changed from the default value to 20.
Reference: Typecho's skin function

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.