Add Custom Element Item In Wp Nav Menu | Code For Developers

Add Custom element item in wp nav menu

Add Element on last item of wp nav menu

Last item for wp_nav_menu

function.php
function add_last_nav_item( $items ) {
    $items .= sprintf(
        '<li class="nav__item social__icon">
   <figure class="icon__container">
     <div class="icon">
      <a href="51$s" target="_blank" class="social__link"><img src="%2$s/images/icon__facebook.svg"></a>
     </div>
     <div class="icon">
       <a href="%3$s" target="_blank" class="social__link"><img src="%2$s/images/icon__youtube.svg"></a> .
     </div>
   </figure>
  </li>',
        'https://www.facebook.com/Czysta-%C5%9Awiadomo%C5%9B%C4%87-%C5%9Awiat%C5%82o-i-Mi%C5%82o%C5%9B%C4%87pl-811435542275919/',
        get_template_directory_uri(),
        'https://www.youtube.com/channel/UCxxKwAW7JE6eCx3OjNcO6Yw/'
    );

    return $items;
}

add_filter( 'wp_nav_menu_items', 'add_last_nav_item' );
Previous Code

Jquery Custom Tab

TweetShareSharePin0 Shares ...

Next Code

Simple jQuery Accordion Collapse

Custom coded Simple jQuery Accordion with toggle a ...

Leave a Reply

Your email address will not be published. Required fields are marked *

If you find it useful

Buy me a coffee

ACF

Elementor

JavaScript

jQuery

Others

PHP

WooCommerce

WordPress

Conditional statement to show pagination

Conditional statement to show pagination on WordPr ...

Remove Website field from WordPress comment & Change cookies remember text

Remove Website field from WordPress comment & Chan ...

Change WordPress URL in Database with phpMyAdmin and SQL query

Replace WordPress old URL to new URL with SQL Quer ...

WordPress Related Post

Show related post on blog single page or any custo ...

WooCommerce Mostly used Shortcode

Most use shortcode for popular eCommerce plugin Wo ...

top