A customer website of the company needs to use different calling contents for different page sidebars of WordPress program. In fact, we can also use widget logic plugin to define the display range of a floating module, but we are not free to define it. So I’m going to use a separate template file to embed the call.
Contents of articleshideFirst, copy sidebar2.php, a separate sidebarSecond, modify the call fileFirst, copy sidebar2.php, a separate sidebar
We will define the sidebar that needs to be defined separately as sidebar2. PHP file, which we need to use later.
Second, modify the call file
We will add the sidebar code in a page:
<?php get_ sidebar(); ?>
To be amended as follows:
<?php include_ once(“sidebar2.php”); ?>
After the modification, we refresh and clean up the cache, and we can see that the sidebar defines the problem separately.