Support » Theme: raindrops » Open menu link in new tab

  • Resolved galapogosian

    (@galapogosian)


    Hi-

    I’ve created a custom menu so that I may link to other pages from the sidebar. In the menu structure tab, each item has a title and link field.

    Photo:

    What I need to do is make each link open in a new tab.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author nobita

    (@nobita)

    Hi galapogosian

    Please open functions.php

    Add first line (<?php before )

    <?php
    add_filter( 'nav_menu_link_attributes','nobita_add_attribute', 10, 3 );
    
    function nobita_add_attribute( $content,$item, $args ){
    
     $content['target']= '_brank';
     return $content;
    }
    ?>

    Thank you.

    Thank you. Worked like a charm!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Open menu link in new tab’ is closed to new replies.