This code enables you to add tabs anywhere in any theme.
Here’s the result with basic styling:
Once you install the code, all you need to do is paste in the HTML for your tabs.
The above demo was generated by pasting the tabs HTML into a single post.
You can add the HTML in your editor on any Edit Post or Page screen, text widget or hook it in using PHP code.
There’s 4 types of code used to create tabs in WordPress :
- jQuery
- PHP
- CSS
- HTML
Code Installation – From Download Folder #
There’s 3 steps involved to use the tabs code :
- Copy the tabs folder and paste it into your child themes root directory.
- Copy the PHP code from the functions.php file and paste it into your child themes functions file.
- Paste the HTML for the tabs anywhere in your theme you want to display your tabs.
Here’s the code for logged in members :
HTML
Once you install the code, paste the HTML into any Edit Post/Page or text widget like this.
You can also hook in the HTML using a custom function.
Hi
I’m using this guide and it works fine. I’m seeing an instance where two words in a tab menu item breaks the line. I know this is a css grid issue but wondered if you could assist?
https://workpei.ca/economic-dashboard/employment/
Thanks
Hello Scot
Add
like this :
Othwerwise, add it to another class.