Add Tabs in Genesis Child Themes

This code enables you to add tabs anywhere in any theme.

Here’s the result with basic styling:

tabs

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 :

  1. Copy the tabs folder and paste it into your child themes root directory.
  2. Copy the PHP code from the functions.php file and paste it into your child themes functions file.
  3. 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.

tabs-html

You can also hook in the HTML using a custom function.

Related Tutorials


Comments

2 responses to “Add Tabs in Genesis Child Themes”

  1. Scot MacDonald Avatar
    Scot MacDonald

    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

    1. Hello Scot

      Add [code]white-space: nowrap;[/code] like this :

      [code]
      .tabs-menu a {
      background-color: #f5f5f5;
      border-radius: 6px 6px 0 0;
      display: grid;
      font-size: 20px;
      text-transform: uppercase;
      margin-right: 2px;
      padding: 8px 12px 6px;
      border-bottom: none;
      white-space: nowrap;
      }
      [/code]

      Othwerwise, add it to another class.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.