Social Media Menu Alignment


Hello Alex,

Maybe I have misunderstood your question, but this is how I would add social icons in the header, attached to the main menu.

function myprefix_add_menu_items() {

 echo '<div class="uk-float-right uk-margin-left">';
   echo '<a href="#" class="uk-icon-button uk-icon-twitter uk-margin-small-left"></a>';
    echo '<a href="#" class="uk-icon-button uk-icon-instagram uk-margin-small-left"></a>';
    echo '<a href="#" class="uk-icon-button uk-icon-facebook uk-margin-small-left"></a>';
 echo '</div>';
 }

 add_action( 'beans_primary_menu_append_markup', 'myprefix_add_menu_items' );

Hope it helps.

Mat


Mat - Thank you so much! I was over complicating it by trying to use a social media menu that wp generates in the admin panel.

It works really well now. Still getting my head around how UIKIt and Beans work together. Great stuff.


Great stuff guys,

Just a quick note, it is better to output HTML without echoing it where possible. To take @matman example, I would suggest:

function myprefix_add_menu_items() {
  ?>
  <div class="uk-float-right uk-margin-left">
   <a href="#" class="uk-icon-button uk-icon-twitter uk-margin-small-left"></a>
    <a href="#" class="uk-icon-button uk-icon-instagram uk-margin-small-left"></a>
    <a href="#" class="uk-icon-button uk-icon-facebook uk-margin-small-left"></a>
 </div>
  <?php
}

add_action( 'beans_primary_menu_append_markup', 'myprefix_add_menu_items' );

Keep up the good work guys,


Fantastic! Thank you both very much.

Write a reply

Login or register to write a reply, it's free!