Skip to main content

Salient Global Sections

Note: Salient Global Sections were added in version 13 of Salient. If you’re not seeing them available, make sure to update your theme and Salient plugins.

Let’s take a closer look at an example that highlights the utility of Global Sections.

Suppose you want to incorporate a site-wide call-to-action area above your footer. In the conventional approach, you would need to manually add it to every page. While this might appear to be a minor inconvenience initially, the real issue arises when future edits need to be made. Updating the section would require revisiting each page individually.

Salient Global Sections addresses this problem by providing a convenient solution for managing templates in a centralized location. Templates added within the Global Sections post type can be assigned to specific areas of your theme or inserted into pages using a page builder element. Any changes made to the core template within the Global Sections post type will automatically propagate to all other instances where the global section has been assigned.

Furthermore, since “Global Sections” is a standard WordPress post type, you can effortlessly export and import the templates you’ve created across different websites!

Getting Started

The Global Sections post type will be located under the Salient options panel your admin WordPress admin.

When accessing it for the first time, you’ll see a notice letting you know that the WPBakery page builder is not set for the post type yet. You can enable it by going to the WPbakery settings → Role Manager and selecting “Custom” for “Post Types”, and finally checking the “salient_g_sections” checkbox.

Global Section Locations & Conditions

Starting from Salient v16, every global section is equipped with a sidebar metabox that grants you precise control over where your global section should be displayed on your website. This enhancement enables you to fine-tune the rendering of your global sections with ease.

Display Locations

  • Set the priority and location of where to render this section on your site. The priority will determine the order of sections when multiple are assigned to the same location.

Display Conditionals

  • Optionally limit the display of your section based on certain conditions such as user privilege, post type etc.

Display Locations

Display locations define the specific areas within your theme where your global section will be attached. Depending on your requirements, you can choose one or multiple locations to suit your needs accordingly.

Display Conditions

Selectively restrict the display of your section based on specific conditions, such as user privileges, post types, and more. When multiple conditions are specified, you can switch between the logical operators ‘AND’ and ‘OR’ by clicking on the label between each condition.

Important: Ensure to add at least one condition to your location or else the global section will not be output anywhere.

Special Locations

There are specific display locations that possess unique characteristics. These locations have the ability to override the default theme functionality and are designed to use a limited number of elements that contribute to the final rendering.

  1. Blog Archive Loop
    • Utilizes the Post Loop Builder page builder element to override the default blog loop template. Additionally, it will impact the related post section on the single blog template.

Finding Output Locations (Hooks)

The global section locations are built upon the WordPress hook system. Salient offers a convenient feature that allows you to showcase all the available Global Section hooks on the frontend of your website. This functionality simplifies the process of locating specific areas.

To access this feature, navigate to the front-end of your website while logged in and click on the “Show Salient Hooks” link located in the top admin bar.

After clicking on a global section hook, you will be automatically redirected to a new global section where the corresponding hook is pre-selected.

Page Builder Element

If you don’t need a template to display on every page in your site, or just want more control on the placement, you can use the aptly named “Global Section” page builder element instead.

Simply assign the desired template to the Global Section element and it will pull the content from your core template.