12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Jul 5, 2021

Page Header in Oxygen

Sridhar Katakam

Updated on July 06, 2021

This members-only tutorial provides the steps to set up a page header in the Main Template that will show the title of the page conditionally depending on the current view (static Page, single post, 404 etc.) when using Oxygen.

We shall

  • exclude the Section having the page header Code Block from being output on homepage and WooCommerce pages.
  • show Post Title for static Pages and singular pages of other post types.
  • show "404 Error Page" on 404 pages.
  • show "Search Results for <search term>" on search pages.
  • show Published Date, Post Title and Author for single posts.
  • show "Blog" for the posts page.
  • show Archive Title for archives.

A static Page:

A 404 page:

A search results page:

A single post:

Posts page or Blog posts index:

A category archive:

Step 1

Edit your Main catch-all Template having the site header, Inner Content and site footer with Oxygen.

Add a Section below the site header.

Give it a class of say, page-header.

Set it your desired background color, say, rgba(224,213,213,0.25).

Advanced > Layout > Display: flex
Align items: center

Text Align: center

Apply the following condition:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.