• Luca

    (@magicianscircle)


    Hi, i’m trying to add the doofinder script for reccomandations (it’s a search engine) on home page of the Theme, but i can’t find a way to make it work and even the doofinder support didn’t handle it, they suggested to ask to you? This is the code where i put a comment on where the script is

    <?php
    /**
     * The blog template file
     *
     * @package yith-proteo
     */
    
    $sidebar_display = yith_proteo_get_sidebar_position();
    $sidebar_show    = yith_proteo_get_sidebar_position( 'sidebar-show' );
    
    get_header();
    
    ?>
    
    
    	<div id="primary" class="content-area <?php echo esc_attr( $sidebar_display ); ?>">
    		<main id="main" class="site-main">
    			<div class="container">
    			<?php if ( 'inside' === get_theme_mod( 'yith_proteo_page_title_layout', 'inside' ) ) : ?>
    				<header class="entry-header">
    					<?php
    					yith_proteo_print_page_titles();
    					?>
    
    <!-- doofinder code-->
    					<script src="https://cdn.doofinder.com/recommendations/js/doofinderRecommendation.min.js"></script>
    					<df-recommendations
      					hashid="58780d42530f5f44416fa88924fbb286"
      					total-products="10"
    					></df-recommendations>
    					<!-- end doofinder code-->
    				
    
    
    </header><!-- .entry-header -->
    			<?php endif; ?>
    				<?php
    				if ( have_posts() ) :
    
    					$post_count = 0;
    					?>
    					<div class="blog-posts columns-<?php echo esc_attr( yith_proteo_get_blog_grid_columns() ); ?> <?php echo esc_attr( yith_proteo_show_blog_posts_with_borders() ); ?>">
    						<?php
    						/* Start the Loop */
    						while ( have_posts() ) :
    							$post_count ++;
    							the_post();
    
    							if ( ( 1 === $post_count && yith_proteo_show_first_post_as_sticky() ) || ( is_sticky() && yith_proteo_show_sticky_posts_wide() ) || 1 === yith_proteo_get_blog_grid_columns() ) {
    								/**
    								* Include the Post-Type-specific template for the content.
    								* If you want to override this in a child theme, then include a file
    								* called content-___.php (where ___ is the Post Type name) and that will be used instead.
    								*/
    								get_template_part( 'template-parts/content', 'sticky' );
    							} else {
    								/**
    								* Include the Post-Type-specific template for the content.
    								* If you want to override this in a child theme, then include a file
    								* called content-___.php (where ___ is the Post Type name) and that will be used instead.
    								*/
    								get_template_part( 'template-parts/content', get_post_type() );
    							}
    						endwhile;
    
    						the_posts_navigation();
    						?>
    					</div>
    					<?php
    					else :
    						get_template_part( 'template-parts/content', 'none' );
    					endif;
    					?>
    			</div><!-- .container -->
    		</main><!-- #main -->
    	</div>
    
                
    <?php
    if ( $sidebar_show ) {
    	get_sidebar();
    }
    get_footer();
    

    Can you help me?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Luca

    (@magicianscircle)

    No one?

    Hi, what do you mean with you cannot make it to work? does the script not print, or it prints but the js not works?

    • This reply was modified 1 year, 6 months ago by Armando.
    • This reply was modified 1 year, 6 months ago by Armando.
    Thread Starter Luca

    (@magicianscircle)

    Hi, Anything i add to the custom theme seems to be ignored.

    Hi, I added that same script to the same file and the script is printed in the frontend. Maybe you are using a cache system?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add a Script to Home page’ is closed to new replies.