Category: How-to

Common requests answered

  • How to Update the Social Links from your template

    Open footer.tpl form your current theme folder:

    /templates/{current theme}/

    Since it’s a basic HTML file, you can edit this file with any text editor.

    Find in file the list-social-sites CSS selector.

    You should be taken to the HTML responsible for your social links. It  should looks something like:

    <li><a href="#"><i class="fa fa-facebook"></i></a></li>
    <li><a href="#"><i class="fa fa-twitter"></i></a></li>
    <li><a href="#"><i class="fa fa-youtube"></i></a></li>
    <li><a href="#"><i class="fa fa-instagram"></i></a></li>

    or

    <li><i class="fa fa-facebook"></i> <a href="#">Facebook</a></li>
    <li><i class="fa fa-twitter"></i> <a href="#">Twitter</a></li>
    <li><i class="fa fa-youtube"></i> <a href="#">YouTube</a></li>
    <li><i class="fa fa-instagram"></i> <a href="#">Instagram</a></li>

    Replace # with your own social profile links.

    Save changes and re-upload the modified file into your theme folder:

    /templates/{current theme}/
  • How to Insert JavaScript Code into PHP Melody

    Inserting any Javascript code (e.g. AdSense) into PHP Melody’s *.tpl files is very easy.

    Since PHP Melody uses the Smarty template engine you do need to wrap your Javascript code between an open and close {literal} tags.

    Here’s an example of how the AdSense code should be added into the <head> part of your site.

    {literal}
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <script>
      (adsbygoogle = window.adsbygoogle || []).push({
        google_ad_client: "ca-pub-0000000000000",
        enable_page_level_ads: true
      });
    </script>
    {/literal}

    Note the opening and closing {literal} tags. That’s how any kind of Javascript code should be injected into any of the *.tpl files from PHP Melody.

    For the official documentation please visit:
    https://www.smarty.net/docs/en/language.function.literal.tpl