PWA
Install XTRA Theme PWA

Install our website's web application on your home screen for quick and easy access every time your are on the go.

Just tap Share then 'Add to home screen'Just tap Share then 'Add to home screen'
XTRA Tutorials
 
  • Getting Started
    • Installing XTRA
    • License Activation
    • Installing Plugins
    • Importing Demo Content
    • Assigning Home Page
    • Updating XTRA
    • Child Theme
  • Page Builder
    • Create a New Page
    • Elements Overview
    • List of Elements
    • General Settings
    • Header Settings
    • SEO Settings
  • Theme Options
    • Options Overview
    • General
      • Layout
      • Colors & Styles
      • Share Icons
      • SEO Meta Tags
      • Loading
      • Page 404
      • Custom Codes
      • White Label
      • Advanced
    • Typography
    • Header
      • Logo
      • Social Icons
      • Header
      • Sticky Header
      • Mobile Header
      • Fixed Side
      • Title and Breadcrumbs
    • Footer
      • Footer Top Bar
      • Footer Widgets
      • Footer Bottom Bar
      • Footer More
    • Blog
      • Blog Settings
      • Blog Styling
      • Blog Single Settings
      • Blog Single Styling
      • Search
    • Portfolio
      • Portfolio Slug & Title
      • Portfolio Settings
      • Portfolio Styling
      • Portfolio Single Settings
    • WooCommerce Pro
      • Products Settings
      • Products Styling
      • Product Settings
      • Product Styling
    • Site Identity
    • Menus
    • Widgets
    • Homepage Settings
    • WooCommerce
    • Additional CSS
    • Backup / Restore
  • Edit Guide
  • How to
  • Developer
Buy Theme
Changelog
XTRA WordPress Theme TutorialsYou arrived at the right place, How we can help you?
XTRA Tutorials
  • Getting Started
    • Installing XTRA
    • License Activation
    • Installing Plugins
    • Importing Demo Content
    • Assigning Home Page
    • Updating XTRA
    • Child Theme
  • Page Builder
    • Create a New Page
    • Elements Overview
    • List of Elements
    • General Settings
    • Header Settings
    • SEO Settings
  • Theme Options
    • Options Overview
    • General
      • Layout
      • Colors & Styles
      • Share Icons
      • SEO Meta Tags
      • Loading
      • Page 404
      • Custom Codes
      • White Label
      • Advanced
    • Typography
    • Header
      • Logo
      • Social Icons
      • Header
      • Sticky Header
      • Mobile Header
      • Fixed Side
      • Title and Breadcrumbs
    • Footer
      • Footer Top Bar
      • Footer Widgets
      • Footer Bottom Bar
      • Footer More
    • Blog
      • Blog Settings
      • Blog Styling
      • Blog Single Settings
      • Blog Single Styling
      • Search
    • Portfolio
      • Portfolio Slug & Title
      • Portfolio Settings
      • Portfolio Styling
      • Portfolio Single Settings
    • WooCommerce Pro
      • Products Settings
      • Products Styling
      • Product Settings
      • Product Styling
    • Site Identity
    • Menus
    • Widgets
    • Homepage Settings
    • WooCommerce
    • Additional CSS
    • Backup / Restore
  • Edit Guide
  • How to
  • Developer

codevz/before_header_2

Home Latest Posts Developer codevz/before_header_2

Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to add content or PHP codes before main header.

XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

Developer

actionbeforeheaderhookmain

FacebookXDeliciousLinkedinWhatsappTelegramEmailPrintShortlink
  • Previouscodevz/after_header_1

  • NextHow to Set Up a GDPR Cookie Consent Notice?

Related Posts ...

Placeholder

How to Change Title Bar ‌Background Image?

How to
Placeholder

How to Easily Change Header Logo Size and Spacing on Mobile Devices?

How to
Placeholder

How to Change Header Logo Size and Spacing?

How to
Placeholder

How to Add Custom Content to the Header in Xtra WordPress Theme: A Step-by-Step Guide?

How to
Placeholder

How to Create Custom Header and Footer Templates Using Elementor?

How to
Placeholder

How to Enable AJAX Mode for the Header Search Form: A Step-by-Step Guide?

How to

XTRA WordPress Theme

XTRA Popular WordPress Theme 2026

Recommended for you …

How to fix Price filter widget doesn’t display in sidebar?

3 June 2024

How to Create a Transparent Header on the Home Page Only?

20 August 2024

How to Fix an Internal Server Error?

14 June 2024

How to Add Custom Content to the Header in Xtra WordPress Theme: A Step-by-Step Guide?

1 September 2024

How to Add a ‘New’ Badge to Recently Added Products?

14 August 2024

How to Change the Home Slider on Your Website?

3 September 2024

How to Create Custom Header and Footer Templates Using Elementor?

27 August 2024

How to Enable Built-In SEO Options in Your Theme?

15 August 2024
If you can't find your answer on this documentation
Submit a ticketSubmit a ticket
© 2025 XTRA WordPress theme documentation.
FacebookInstagramYoutubeDribbble
This website uses cookies to improve user experience.Accept and close
Download Xtra Theme Purchase Theme Xtra Theme Documentation Documentation Xtra Theme Videos Tutorials Video Tutorials Xtra Theme Support Center Support center Xtra Theme Showcase Showcase