• Resolved rdavey

    (@rdavey)


    Hello,

    I am using Relevanssi Premium on a multi-site client website and have noticed some very strange link behavior in the search results. Everything looks good for search results, but if you hover over or go to the link it goes to a completely unrelated page compared to what the title and excerpt says. For example I searched “principal” and the first link seems to be working properly, but the following ones are not at all.

    If it helps, here are the contents of my search template.

    <?php
    /**
     * Search Template
     *
     * The search template is used to display search results from the native WordPress search.
     *
     * If no search results are found, the user is assisted in refining their search query in
     * an attempt to produce an appropriate search results set for the user's search query.
     *
     * @package WooFramework
     * @subpackage Template
     */
    
     get_header();
     global $woo_options;
    ?>
        <!-- #content Starts -->
        <?php switch_to_blog($post->blog_id); ?>
            <?php woo_content_before(); ?>
            <div id="content" class="col-full">
    
                <div id="main-sidebar-container">    
    
                    <!-- #main Starts -->
                    <?php woo_main_before(); ?>
                    <div id="main" class="col-left">
    
                    <?php get_template_part( 'loop', 'search' ); ?>
    
                    </div><!-- /#main -->
                    <?php woo_main_after(); ?>
    
                    <?php get_sidebar(); ?>
    
                </div><!-- /#main-sidebar-container -->         
    
                <?php get_sidebar( 'alt' ); ?>       
    
            </div><!-- /#content -->
            <?php woo_content_after(); ?>
        <?php restore_current_blog(); ?>
    
    <?php get_footer(); ?>

    Any help would be greatly appreciated. Thanks!

    http://milfordk12.org/

    https://ww.wp.xz.cn/plugins/relevanssi/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Since you’re using Premium, you’re probably a paying customer, so you can use the support for paying customers at http://www.relevanssi.com/support/ – I recommend very much using that, it’ll get you answers faster (questions sent there will ping my phone).

    Can you show me loop-search.php? You probably need to change the way the permalinks are created so that they point to the correct place. The theme is likely using get_permalink(), and it needs to be changed to relevanssi_get_permalink().

    Thread Starter rdavey

    (@rdavey)

    I tried using the support form mentioned on the page, but for some reason it didn’t show up for me even when logged in.

    Anyway, here are the contents of loop-search.php from the parent theme:

    <?php
    /**
     * Loop - Search
     *
     * This is the loop logic used on the search results screen.
     *
     * @package WooFramework
     * @subpackage Template
     */
     global $more; $more = 0;
    
    woo_loop_before();
    if (have_posts()) { $count = 0;
    
    	$title_before = '<span class="archive_header">';
    	$title_after = '</span>';
    
    	echo $title_before . sprintf( __( 'Search results for "%s"', 'woothemes' ), get_search_query() ) . $title_after;
    ?>
    
    <div class="fix"></div>
    
    <?php
    	while (have_posts()) { the_post(); $count++;
    
    		if (get_option('woo_woo_tumblog_switch') == 'true') { $is_tumblog = woo_tumblog_test(); } else { $is_tumblog = false; }
    
    		woo_get_template_part( 'content', 'search' );
    
    	} // End WHILE Loop
    } else {
    	get_template_part( 'content', 'noposts' );
    } // End IF Statement
    
    woo_loop_after();
    
    woo_pagenav();
    ?>

    Thanks again for any help!

    Plugin Author Mikko Saari

    (@msaari)

    Hi, the answer is hidden still deeper in the templates. What’s inside content-search.php?

    Thread Starter rdavey

    (@rdavey)

    It actually was within content-search.php. This had been discovered yesterday afternoon and I wanted to update you then, but they were doing maintenance. Thank you for your help and it seems to be working great now!

    Plugin Author Mikko Saari

    (@msaari)

    That’s good to hear. Can you please mark this thread as resolved now the problem is solved?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Strange link behavior’ is closed to new replies.