Widget logic is one of the most useful WordPress plugins. Through settings, Widget logic can allow different pages of the blog to display different sidebars. This feature is very useful when you plan to display ads or other content in the sidebar without having to modify the template.
You can download this plug-in from the wordpress.org website. After installation, it needs to be activated for normal use.
Example—Show "Latest Log" in the sidebar of all pages except the homepage
Step 1: Add the “Latest Log” option to the sidebar
Log in to the blog's management background, then click the widget menu, drag the "Latest Log" option to the right sidebar, then set the relevant title, display the number of logs (for example: 5), and finally click the "save" button.
Step 2: Add page display conditions
At the bottom of all widgets, there is an option box called "widget logic". Enter page display conditions here to control the display of the sidebar. It doesn’t matter if you are a newbie, you can follow the instructions below to set it up: WordPress Codex - Conditional Tags
In this example, the filter condition I set is "all pages except the homepage". Because the function to determine the home page is: is_home(), then the statements for all pages except the home page should be: !is_home(). Enter this statement in the widget logic option box and save it.
More advanced conditional judgment functions
is_single()-> Determine whether it is a single log
is_page()-> Determine whether it is a single page
is_page('about')->determine whether it is an about page
is_page('25′)->determine whether it is the page with id=25
is_archive()-> Determine whether it is an archive
is_category('wordpress')-> Determine whether it is a directory with the alias "wordpress"
is_category('37′) -> Determine whether it is the directory with id=37
has_tag ('wordpress')-> Determine whether there is a tag named "wordpress"
This article is exclusively provided by The Fastest Way to Enlarge Breasts http://www.hiways.com.cn , please indicate when reprinting. Thanks!
Widget logic is one of the most useful WordPress plugins. Through settings, Widget logic can allow different pages of the blog to display different sidebars. This feature is very useful when you plan to display ads or other content in the sidebar without having to modify the template.
You can download this plug-in from the wordpress.org website. After installation, it needs to be activated for normal use.
Example—Show "Latest Log" in the sidebar of all pages except the homepage
Step 1: Add the “Latest Log” option to the sidebar
Log in to the blog's management background, then click the widget menu, drag the "Latest Log" option to the right sidebar, then set the relevant title, display the number of logs (for example: 5), and finally click the "save" button.
Step 2: Add page display conditions
At the bottom of all widgets, there is an option box called "widget logic". Enter page display conditions here to control the display of the sidebar. It doesn’t matter if you are a newbie, you can follow the instructions below to set it up: WordPress Codex - Conditional Tags
In this example, the filter condition I set is "all pages except the homepage". Because the function to determine the home page is: is_home(), then the statements for all pages except the home page should be: !is_home(). Enter this statement in the widget logic option box and save it.
More advanced conditional judgment functions
is_single()-> Determine whether it is a single log
is_page()-> Determine whether it is a single page
is_page('about')->determine whether it is an about page
is_page('25′)->determine whether it is the page with id=25
is_archive()-> Determine whether it is an archive
is_category('wordpress')-> Determine whether it is a directory with the alias "wordpress"
is_category('37′) -> Determine whether it is the directory with id=37
has_tag ('wordpress')-> Determine whether there is a tag named "wordpress"
This article is exclusively provided by The Fastest Way to Enlarge Breasts http://www.hiways.com.cn , please indicate when reprinting. Thanks!
Editor-in-Chief: Yangyang author’s cool personal space