Typecho the content title of an article in a single loop!

Source: Internet
Author: User

I want to print out a single page I want to specify the content and title of the article

Somewhat similar to the TYPECHO classification under the article output

I looked for 2 hours Baidu did not have this article! Had to solve it!

Reply content:

I want to print out a single page I want to specify the content and title of the article

Somewhat similar to the TYPECHO classification under the article output

I looked for 2 hours Baidu did not have this article! Had to solve it!

Not very clear about your description.
If you want to get a specific article, such as the article CID is known, then you can:

$post = $this->widget('Widget_Archive@post', 'type=post', 'cid=1');$post->title();

If you want to get all the articles under a particular category, such as mid-known, then you can:

$category = $this->widget('Widget_Archive@category', 'pageSize=6&type=category', 'mid=1');while($category->next()){    ... ...}

Reference: "widget_archive common Code Snippets Collection"

  • 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.