WordPress.org

Ready to get started?Download WordPress

Forums

Relevanssi - A Better Search
[resolved] No links to results in search results. (10 posts)

  1. tiamaureenjohnson
    Member
    Posted 8 months ago #

    url: http://www.libertarianresources.com/

    Search results show up, but there are no links to the content where results are found.

    In other words, the search result is a block of text with searched word highlighted, but no links are created to take user to where the searched word is on the site. Is there no function for that?

    All help is appreciated

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

  2. Mikko Saari
    Member
    Plugin Author

    Posted 8 months ago #

    Nope, no solution for that, as Relevanssi doesn't really have any information about the location of words in the documents. Also, Relevanssi can't just add link anchors in the posts when they are displayed.

    Browser in-page search is the best solution in this case.

  3. Mikko Saari
    Member
    Plugin Author

    Posted 8 months ago #

    Ah, I looked at your site and that's not what you mean...

    You need to edit your search results template. It's broken, as it's missing post titles and links to the posts.

    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

    adds the title and

    <a href="<?php the_permalink(); ?>">Read more...</a>

    adds a link to the post, when added to your search results template.

  4. tiamaureenjohnson
    Member
    Posted 8 months ago #

    Thanks for the help and the plugin.

    Paste these right into the [child theme] search results template, search.php? I attempted that but no change.

    Are there opening and closing tags that need to be included? Seems odd that one would put html tags into the php templates, but I know very little about programming.

    Appreciate the help.

  5. Mikko Saari
    Member
    Plugin Author

    Posted 8 months ago #

    These should go the the search.php, yes, and outside PHP code sections. PHP templates often contain plain HTML code (and the HTML code I gave you contains PHP code).

    If you share your search results template (put it in a pastebin), I can show you the correct place.

  6. tiamaureenjohnson
    Member
    Posted 8 months ago #

    <?php
    /**
    * Displays the search results of the theme.
    *
    * @package Theme Horse
    * @subpackage Attitude
    * @since Attitude 1.0
    */
    ?>

    <?php get_header(); ?>

    <?php
    /**
    * attitude_before_main_container hook
    */
    do_action( 'attitude_before_main_container' );
    ?>

    <div id="container">
    <?php
    /**
    * attitude_main_container hook
    *
    * HOOKED_FUNCTION_NAME PRIORITY
    *
    * attitude_content 10
    */
    do_action( 'attitude_main_container' );
    ?>
    </div><!-- #container -->

    <?php
    /**
    * attitude_after_main_container hook
    */
    do_action( 'attitude_after_main_container' );
    ?>

    <?php get_footer(); ?>

    Hope that is what you meant by pastebin.

  7. Mikko Saari
    Member
    Plugin Author

    Posted 8 months ago #

    Ah, that gets complicated. Ask your theme developer, they'll know. They're the ones who made the broken theme in the first place...

  8. tiamaureenjohnson
    Member
    Posted 8 months ago #

    Ha, ha. I appreciate the help anyway, thank you.

  9. pmoore26
    Member
    Posted 5 months ago #

    Hi, I've run into this problem, too, now that my site has gone live. It is using the latest version of the Iconic Theme. This functionality worked fine on the previewDNS site, but now that it is live, the [...] link appears at the bottom of each search result but it isn't linked.

    What can I do to fix this?

  10. Mikko Saari
    Member
    Plugin Author

    Posted 5 months ago #

    This is a theme question, so you're better off asking Iconic developers about this.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags