Widget logic make your sidebar different

Source: Internet
Author: User
Keywords WordPress

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Widget logic is one of the most useful WordPress plug-ins. By setting up, Widget logic can let different pages of a blog display a different sidebar. This is useful when you want to display ads or other content in the sidebar without having to bother modifying the template.

You can download this plugin from the WordPress.org website, after installation, you need to activate to normal use.

Instance-Displays the "latest log" in the sidebar of all pages except the first page

Step One: Add the "latest log" option to Sidebar

Log in to the management background of the blog, then click on the Widget menu, drag the "latest log" option to the right sidebar, and then set the relevant title, display log number (for example: 5), the last point "save" button.

Step Two: Add page display criteria

At the bottom of all gadgets, there is an option box, "Widget logic." Enter the page display condition here to control the display of the sidebar. Novice If you do not understand, you can refer to the following instructions to set: WordPress codex-conditional Tags

In this case, the filter I set is "except all pages on the first page." Because judge the function of the first page is: Is_home (), then the statement of all pages except the first page should be:!is_home (). Enter the statement in the Widget logic option box and save it.

  

More advanced conditional Judgment functions

Is_single ()-> to determine whether a single log

Is_page ()-> determines whether a single page

Is_page (' about ')-> whether it's about page

Is_page (' 25′)-> to determine if the page is id=25

Is_archive ()-> determine if the archive

Is_category (' WordPress ')-> to determine whether the alias is "WordPress" Directory

Is_category (' 37′)-> A directory that determines whether it is id=37

Has_tag (' WordPress ')-> determine if there is a label named "WordPress"

This article by the breast enhancement quickest method http://www.hiways.com.cn exclusive feeds, reprint please specify. Thank you!

Widget logic is one of the most useful WordPress plug-ins. By setting up, Widget logic can let different pages of a blog display a different sidebar. This is useful when you want to display ads or other content in the sidebar without having to bother modifying the template.

You can download this plugin from the WordPress.org website, after installation, you need to activate to normal use.

Instance-Displays the "latest log" in the sidebar of all pages except the first page

Step One: Add the "latest log" option to Sidebar

Log in to the management background of the blog, then click on the Widget menu, drag the "latest log" option to the right sidebar, and then set the relevant title, display log number (for example: 5), the last point "save" button.

Step Two: Add page display criteria

At the bottom of all gadgets, there is an option box, "Widget logic." Enter the page display condition here to control the display of the sidebar. Novice If you do not understand, you can refer to the following instructions to set: WordPress codex-conditional Tags

In this case, the filter I set is "except all pages on the first page." Because judge the function of the first page is: Is_home (), then the statement of all pages except the first page should be:!is_home (). Enter the statement in the Widget logic option box and save it.

  

More advanced conditional Judgment functions

Is_single ()-> to determine whether a single log

Is_page ()-> determines whether a single page

Is_page (' about ')-> whether it's about page

Is_page (' 25′)-> to determine if the page is id=25

Is_archive ()-> determine if the archive

Is_category (' WordPress ')-> to determine whether the alias is "WordPress" Directory

Is_category (' 37′)-> A directory that determines whether it is id=37

Has_tag (' WordPress ')-> determine if there is a label named "WordPress"

This article by the breast enhancement quickest method http://www.hiways.com.cn exclusive feeds, reprint please specify. Thank you!

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.