WordPress defines different page calls different Sidebar templates

Source: Internet
Author: User

A company website needs to use different calling content on the page bar of different WordPress programs. In fact, we can also use the Widget Logic plug-in to define the display range of a floating module, but it is not freely defined. So I am going to use a separate template file to embed the call.

First, copy a separate sidebar sidebar2.php

We will define the sidebar that needs to be defined separately as the sidebar2.php file, which will be used later.

2. Modify the call File

We will Code the sidebar in a page:


<? Php get_sidebar ();?>


Modify:

<? Php include_once ("sidebar2.php");?>

After the modification is complete, refresh and clear the cache. You can see that the problem is resolved separately on the sidebar.

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.