Archived topic
Significant changes in single.php (recent update)
7 replies · Started by Gerardo on November 30, 2020
Dears,
In https://sandbox.ital2.org we're using Heyoya comments area. To do this I needed to insert an extra line of code (a little snippet) into the single.php file.
Now, I've recently updated the version of GP and into the PHP file I can't find the area where I used to put the Heyoya script.
Here is how it was (nothing changed up to line 22 [do_action( 'generate_before_main_content' );]):
...
do_action( 'generate_before_main_content' );while ( have_posts() ) : the_post();
get_template_part( 'content', 'single' );
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || '0' != get_comments_number() ) :
/**
* generate_before_comments_container hook.
*
* @since 2.1
*/
do_action( 'generate_before_comments_container' );
?><?php
endif;endwhile;
/**
* generate_after_main_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_main_content' );
?>
</main><!-- #main -->
<!-- #primary -->
<?php
/**
* generate_after_primary_content_area hook.
*
* @since 2.0
*/
do_action( 'generate_after_primary_content_area' );
generate_construct_sidebars();
get_footer();
After updating GP what I have is just:
...
do_action( 'generate_before_main_content' );if ( generate_has_default_loop() ) {
while ( have_posts() ) :the_post();
generate_do_template_part( 'single' );
endwhile;
}/**
* generate_after_main_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_main_content' );
?>
</main>
<?php
/**
* generate_after_primary_content_area hook.
*
* @since 2.0
*/
do_action( 'generate_after_primary_content_area' );
generate_construct_sidebars();
get_footer();
So, in the end I went to just before the closing body tag and put the snippet, but the result was very bad.
This is how the comments area looked before updating (correct):
This is how it looks now:
Thanks for your attention.
Best
<script type="text/javascript" src="https://commerce-static.heyoya.com/b2b/b2b_settings.hey?affId=V4DIH0gsTH"></script><hr />
<?php comments_template(); ?>