Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1353572
    miribetancourt
    Participant

    Hi Themeco,

    I would like to integrate a facebook-like-button and the opportunity to like at the bottom of the blogposts. Am I correct that you do not provide for that?

    Thus, I looked for a different solution and found Storeya. Therefore, I have to integrate code in front of the </body>-tag. Where and how can I do that? Or is there a better solution than Storeya?

    Webseite: http://www.kraeuterpracht.de
    WordPress 4.7.2
    Renew
    Cornerstore 1.3.3

    Thanks, Miriam

    #1353619
    Thai
    Moderator

    Hi Miriam,

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please add following PHP code below into functions.php locates in child theme’s folder:

    add_action( 'x_before_site_begin', 'print_script_before_site_begin' );
    function print_script_before_site_begin(){
    	?>
    	<div id="fb-root"></div>
    	<script>(function(d, s, id) {
    	  var js, fjs = d.getElementsByTagName(s)[0];
    	  if (d.getElementById(id)) return;
    	  js = d.createElement(s); js.id = id;
    	  js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.8&appId=490866727757684";
    	  fjs.parentNode.insertBefore(js, fjs);
    	}(document, 'script', 'facebook-jssdk'));</script>
    	<?php
    }
    
    add_action( 'x_after_the_content_end', 'add_to_single_posts' );
    function add_to_single_posts() {
    	?>
    	<div class="fb-like" data-href="<?php the_permalink(); ?>" data-layout="standard" data-action="like" data-size="small" data-show-faces="true" data-share="false"></div>
    	<?php
    }

    Hope it helps.

    #1355167
    miribetancourt
    Participant

    Hi Thai,

    thanks for the effort. I will give it a try.
    Miriam

    #1355371
    Rupok
    Member

    Great. Let us know how it goes.

    Cheers!

    #1359389
    miribetancourt
    Participant

    Hi,

    in the folder it shows:

    <?php

    // =============================================================================
    // FUNCTIONS.PHP
    // —————————————————————————–
    // Overwrite or add your own custom functions to X in this file.
    // =============================================================================

    // =============================================================================
    // TABLE OF CONTENTS
    // —————————————————————————–
    // 01. Enqueue Parent Stylesheet
    // 02. Additional Functions
    // =============================================================================

    // Enqueue Parent Stylesheet
    // =============================================================================

    add_filter( ‘x_enqueue_parent_stylesheet’, ‘__return_true’ );

    // Additional Functions
    // =============================================================================

    Where exactly do I have to poste the PHP code?

    Thanks for your help. Cheers

    #1359406
    Christian
    Moderator

    Below

    // Additional Functions
    // =============================================================================
  • <script> jQuery(function($){ $("#no-reply-1353572 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>