• Resolved troour56

    (@flo563)


    Hi,

    I have an problem with all my “search results page”.
    On each page, one post isn’t correctly displayed.

    For example, if you search the word “breizh” http://www.daskor.org/?s=breizh
    I have an article per page that is not well displayed. In the first search results page, instead of “title, date, No comment,” I see “3262Pas de commentaire” (3262 is the ID of the post not correctly displayed)

    On each page I have a post with the problem, but I don’t understand why…

    Do you have an idea ?

    Thanks for your help.

    http://wordpress.org/extend/plugins/relevanssi/

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

    (@msaari)

    Do you know where that “Pas de commentaire” comes from?

    Can you show me your search results template?

    Thread Starter troour56

    (@flo563)

    I have found it. The “Pas de commentaire” means in French “No comments”, it’s the translation in the file fr_FR.po for wordpress.

    My Search.php file :

    <?php global $theme; get_header(); ?>
    
        <div id="main">
    
            <?php $theme->hook('main_before'); ?>
    
            <div id="content">
    
                <?php $theme->hook('content_before'); ?>
    
                <h2 class="page-title"><?php _e( 'Search Results for:', 'themater' ); ?> <span><?php echo get_search_query(); ?></span></h2>
    
                <?php
                    $is_post_wrap = 0;
                        if (have_posts()) : while (have_posts()) : the_post();
    
                         /**
                         * The default post formatting from the post.php template file will be used.
                         * If you want to customize the post formatting for your search pages:
                         *
                         *   - Create a new file: post-search.php
                         *   - Copy/Paste the content of post.php to post-search.php
                         *   - Edit and customize the post-search.php file for your needs.
                         *
                         * Learn more about the get_template_part() function: http://codex.wordpress.org/Function_Reference/get_template_part
                         */
    
                        $is_post_wrap++;
                            if($is_post_wrap == '1') {
                                ?><div class="post-wrap clearfix"><?php
                            }
                            get_template_part('post', 'search');
    
                            if($is_post_wrap == '2') {
                                $is_post_wrap = 0;
                                ?></div><?php
                            }
                    endwhile;
    
                    else : ?>
                        <div class="entry">
                            <p><?php printf( __( 'Sorry, but nothing matched your search criteria: %s. Please try again with some different keywords.', 'themater' ), '<strong>' . get_search_query() . '</strong>' ); ?></p>
                        </div>
    
                        <div id="content-search">
                            <?php get_search_form(); ?>
                        </div>
                    <?php endif; 
    
                        if($is_post_wrap == '1') {
                            ?></div><?php
                        }
                    get_template_part('navigation');
                ?>
    
                <?php $theme->hook('content_after'); ?>
    
            </div><!-- #content -->
    
            <?php get_sidebars(); ?>
    
            <?php $theme->hook('main_after'); ?>
    
        </div><!-- #main -->
    
    <?php get_footer(); ?>

    Thread Starter troour56

    (@flo563)

    And my post.php page (I haven’t a post-search.php page)

    <?php global $theme; ?>
    
        <div <?php post_class('post post-box clearfix'); ?> id="post-<?php the_ID(); ?>">
    
            <h2 class="title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'themater' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    
            <div class="postmeta-primary">
    
                <span class="meta_date"><?php echo get_the_date(); ?></span>
    
                <?php if(comments_open( get_the_ID() ))  {
                        ?> &nbsp; <span class="meta_comments"><?php comments_popup_link( __( 'No comments', 'themater' ), __( '1 Comment', 'themater' ), __( '% Comments', 'themater' ) ); ?></span><?php
                    }
                ?>
            </div>
    
            <div class="entry clearfix">
    
                <?php
                    if(has_post_thumbnail())  {
                        ?><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(
                            array($theme->get_option('featured_image_width'), $theme->get_option('featured_image_height')),
                            array("class" => $theme->get_option('featured_image_position') . " featured_image")
                        ); ?></a><?php
                    }
                ?>
    
                <p>
                    <?php
                      echo $theme->shorten(get_the_excerpt(), '40');
                    ?>
                </p>
    
            </div>
    
            <?php if($theme->display('read_more')) { ?>
            <div class="readmore">
                <a href="<?php the_permalink(); ?>#more-<?php the_ID(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'themater' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php $theme->option('read_more'); ?></a>
            </div>
            <?php } ?>
    
        </div><!-- Post ID <?php the_ID(); ?> -->

    Thread Starter troour56

    (@flo563)

    I have try to delete each line in my theme file in order to see the results, and I have found that this line was guilty..

    echo $theme->shorten(get_the_excerpt(), '40');

    So I have remplace it by a simple

    echo get_the_excerpt();

    And now it works, it was not Relevanssi but my theme.

    Sorry for this post, and thanks to you for your help !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Relevanssi – A Better Search] One post missing on each search results page’ is closed to new replies.