How does Typecho homepage paging and article paging?

Source: Internet
Author: User
Because we often write long articles, We Need To paging the homepage for the sake of appearance, that is, only the specified part of content is displayed during the homepage preview, but unfortunately the index is fixed. php allows each article to display a fixed number of words. How can I set the number of words displayed in each article... the second is the homepage article list... because we often write long articles, We Need To paging the homepage for the sake of appearance, that is, only the specified part of content is displayed during the homepage preview, but unfortunately the index is fixed. php allows each article to display a fixed number of words. How can I set the number of words displayed in each article... the second is how to display the articles on the home page by page... because the number of articles is large.

Reply content:

Because we often write long articles, We Need To paging the homepage for the sake of appearance, that is, only the specified part of content is displayed during the homepage preview, but unfortunately the index is fixed. php allows each article to display a fixed number of words. How can I set the number of words displayed in each article... the second is how to display the articles on the home page by page... because the number of articles is large.

You can use custom fields, and then the home page displays the content you want to display with custom fields, see: http://docs.typecho.org/help/custom-fields

In addition, the homepage article should normally be paginated. You can set the number of articles displayed on each page in the background settings.

If you need some advanced paging features, such as 20 pages on the home page and 40 pages on the search page, you can consider modifying functions. php

For example, modify the default pageSize to 20.

Function themeInit ($ archive) {if ($ archive-> is ('index') {$ archive-> parameter-> pageSize = 20; // Number of custom entries }}

The function is to change the number of articles displayed on each page of the homepage from the default value to 20.
Reference: Skin functions of typecho

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.