Add FB Connect button to Top Navigation bar

Hi, I am trying to add the FB Connect login button via the short code to my top navigation bar (which contains About Us etc) on tragicfanatics.com however I cannot see where to add this. I am assuming it should be done via the Header PHP file...any tips would be most appreciated. Thanks

  • Kimberly

    Hi Brad,

    Welcome to the WPMUdev Community!

    You are correct, you will need to place the shortcode in the header.php file. However shortcodes do not work the same way in php files as they do in the editor. You will need to change up the text a bit to make it work.

    // Use shortcode in a PHP file (outside the post editor).
    echo do_shortcode('[yourshortcodehere]');

    This should fix you up :slight_smile:

    Let me know if you have any trouble!

    Best,

    Kimberly

    If the above action did not result in the resolution or common end to this ticket then please feel free to come back here for comment. Just be sure you mark "Not Resolved" to re-open or we might miss it! :slight_smile: Thanks!

  • brad_paterson

    Hi Kimberly,

    Thanks for the reply. I tried the above code by pasting it within the Header PHP where i believe the Top Navigation bar code is and only saw the actual words of the code appear in the Nav Bar not the button. I substituted the FB button short code and tried different variations of the above.

    Could you please let me know what I am doing wrong, I am still quite the novice with most PHP.

    Thanks
    Brad

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.