adding items to nav-menu
-
Im using the 3.8 version of wordpress and I’m trying to add some custom social items to the navigation menu – something I’ve done several times before on previous versions of wp. But for some reason i simply can’t get it to work now.
Here is my code, put into the child themes functions.php:
<?php /** *functions.php for Child theme */ /* Social Icons */ function menu_social($items){ $social = '<li class="social">'; $social .= '<a href="https://www.facebook.com/christel.winther">'; $social .= '<img src="https://selgolb.cphadsdemo.dk/wp-content/themes/christel/images/facebook.png" /> </a>'; $social .= '<a href="https://twitter.com/ChristelWinther">'; $social .= '<img src="https://selgolb.cphadsdemo.dk/wp-content/themes/christel/images/twitter.png" /> </a>'; $social .= '<a href="dk.linkedin.com/pub/christel-winther/2/409/b03">'; $social .= '<img src="https://selgolb.cphadsdemo.dk/wp-content/themes/christel/images/linkedin.png" /> </a>'; $social .= '<a href="https://christelwinther.com/feed">'; $social .= '<img src="https://selgolb.cphadsdemo.dk/wp-content/themes/christel/images/rss.png" /> </a>'; $social .= '</li>'; return $items . $social; } add_filter('wp_nav_menu_items','menu_social'); ?>
The website url is: https://selgolb.cphadsdemo.dk
- The topic ‘adding items to nav-menu’ is closed to new replies.