Search for Resources and Solutions

Add analytics code in the Midrub Frontend Themes

Midrub has 3 kind of themes:

  • Frontend - for public.
  • User - for users/clients.
  • Admin - for administrators.

Each theme theme type has it's structure and after Midrub 0.0.8.1 you will see the benefits of these themes.

In this article i want to explain how to add custom css and js code in the frontend Midrub's theme. You can use this feature to add the chat code, analytics code or other kind of js code.

To add your css code in the frontend theme:

  • Go to admin panel.
  • Click on the Frontend's menu item.
  • Click on Frontend Settings.
  • Click on Header and add your CSS code.


To add your js code in the frontend's theme:

  • Go to admin panel.
  • Click on the Frontend's menu item.
  • Click on Frontend Settings.
  • Click on Footer and add your JS code.



If you have created a new theme, just add inside the header tags this code:

                                                
get_the_frontend_header();




And inside the body tags add this code:

                                                
get_the_frontend_footer();

If you're comparing these functions with the user's functions for same scope, them has frontend word. I've added it to avoid any conflicts.






Was this article helpful?