dimanche 14 mars 2021

Display header based on user role and page (Wordpress)

I have created multiple different headers as templates with Elementor.

I would like to display all of the different headers based on user role (Logged in/Logged out) and page.

I'm looking for a code snippet that I could easily customize to assign all of the different headers for different scenarios.

Could someone please create an example code snippet that would:

  • Display header A for Logged Out users on the entire website, EXCEPT pages X and Y.
  • Display header B for Logged In users on the entire website, EXCEPT pages X and Y.
  • Display header C for Logged Out users only on pages X and Y.
  • Display header D for Logged In users only on pages X and Y.

This way, people can easily copy the code and customize it to fit their needs.

Aucun commentaire:

Enregistrer un commentaire