• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Add Phone Number & Skype To WordPress Nav Menu

Displaying text or HTML in any Genesis theme is easy using widgets but what if you want to add your phone number in a nav menu?

The code snippets in this tutorial, enables you to add your phone number and some text/HTML to the left or right hand side of any navigation menu.

There are multiple snippets included in this post which also enable you to add a click to call phone number as well as a click to Skype link.

The code works in any theme.

ph number

Click to Call Demo

click-to-call

Register for full access

Related Tutorials

  • Add Text Phone Number Inline With Custom Nav Menu in Header Right Widget

Reader Interactions

Comments

  1. fotod0g13 says

    November 15, 2017 at 8:20 am

    Hi Brad-
    Is there a way to make a click to call when using the header right widget to show the phone number. Using the Parrallax Pro theme here:
    http://harleydavidsonservicenyc.com/

    thanks for the help

    Log in to Reply
    • fotod0g13 says

      November 15, 2017 at 9:33 am

      figured this out on my own- looks like it is all set – sorry for the inconvenience

      Log in to Reply
  2. Brenda Sargeant says

    May 12, 2014 at 8:59 pm

    This is such a great resource for me! Thanks 😀

    Log in to Reply
  3. Anne-Marie says

    December 3, 2013 at 1:35 am

    Hi!
    I modified this to add text to my primary nav bar, and I keep getting an error message. Can you tell me where I went wrong?

    //* Add tagline to right Genesis primary nav
    add_filter( ‘wp_nav_menu_items’, ‘tagline’, 10, 2 );
    function add_tagline_nav_menu( $menu, stdClass $args ){
    if ( ‘primary’ != $args->theme_location )
    return $menu;
    if( genesis_get_option( ‘nav_extras’ ) )
    return $menu;
    $menu .= sprintf( ‘%s’, __( ‘run mad as often as you choose’ ) );
    return $menu;
    }

    But I keep seeing “Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘tagline’ not found or invalid function name in /home/donotfai/newdesign/wp-includes/plugin.php on line 199”

    I tried deactivating all plugins, but that didn’t fix it. Thanks in advance! This was a really helpful place to start!

    Log in to Reply
    • Brad Dalton says

      December 3, 2013 at 1:21 pm

      Where did you get the code Anne-Marie?

      When you copy and paste code into a webpage you need to use a Gist or wrap it in short-codes otherwise the single quotes turn around causing errors.

      You can use any of the code snippets in this post and simply replace the phone number with text.

      add_filter( 'wp_nav_menu_items', 'add_phone_number_second_nav_menu', 10, 2 );
      
      function add_phone_number_second_nav_menu( $menu, stdClass $args ){
              
             
              if ( 'secondary' != $args->theme_location )
              	return $menu;
              
                     if( genesis_get_option( 'nav_extras' ) )
                      return $menu;
              
              $menu .= sprintf( '<li class="right ph-num">%s</li>', __( 'run mad as often as you choose' ) );
              
              
              return $menu;
              
      }
      Log in to Reply
      • Anne-Marie says

        December 3, 2013 at 1:27 pm

        Oh, I know it looks awful in the comment–I copied what you had here and edited it in Notepad, then uploaded FTP. I changed add_phone_number to add_tagline and ph-num to tagline. Then I replaced your number with my text. Got the error message.

        Log in to Reply
        • Brad Dalton says

          December 3, 2013 at 1:34 pm

          No need to change the filter or function name Anne-Marie.

          Simply change the phone number to your text and paste it at the end of your child themes functions file using a text editor and it will work as i have tested all the code.

          Log in to Reply
          • Anne-Marie says

            December 3, 2013 at 1:50 pm

            I’ll try it! Can you tell I’m a writer trying to learn code? Thanks so much.

          • Brad Dalton says

            December 3, 2013 at 2:28 pm

            hahaha. Understand. It’s a challenge writing code which is why i try and make it as easy as possible for people.

            The great thing about PHP code is that either works or it doesn’t, unlike CSS code.

          • Anne-Marie says

            December 3, 2013 at 2:40 pm

            It worked! Oh, that’s so much work you saved me trying to figure that out on my own!

            PHP code is a more difficult language, but yes, at least it’s either working or broken. CSS just ignores whatever I get wrong, and sends me searching through all 4 million lines of child theme code. 😛

            Thank you a million times.

          • Brad Dalton says

            December 3, 2013 at 2:46 pm

            You’re welcome Anne-Marie.

  4. Samantha says

    November 22, 2013 at 4:57 am

    Thanks very much, Brad. This is EXACTLY what I needed. Will be bookmarking for future reference!

    Log in to Reply
    • Brad Dalton says

      November 22, 2013 at 8:47 am

      No worries Samantha.

      Log in to Reply
      • Samantha says

        November 22, 2013 at 9:49 am

        Aussie?!

        Log in to Reply
        • Brad Dalton says

          November 22, 2013 at 10:42 am

          Yes but don’t live there. Melbourne’s weather isn’t to my liking!

          Log in to Reply
          • Samantha says

            November 22, 2013 at 10:46 am

            You should try Brisbane 🙂

          • Brad Dalton says

            November 22, 2013 at 10:48 am

            Brother lives there.

            Lived on Hayman and Hamilton island when i was 20 and loved it. Now in Asia.

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.