• So I have an addthis code applied to my search results post, something like this:

    <a href="http://www.addthis.com/bookmark.php" class="addthis_button"
        addthis:url="<?php the_permalink() ?>"
        addthis:title="<?php echo the_title_attribute(); ?>">
        <p class="share-link right">Share</p>
    </a>

    The problem is that even in the the_title_attribute() call I get the score and then it appears in the tweet/post that the user shares. Racing a deadline so would appreciate a quick response. Thanks for your plugin, great job on it.

    http://wordpress.org/plugins/searchrelevance/

Viewing 1 replies (of 1 total)
  • Plugin Author sablednah

    (@sablednah)

    Apologies for the delay – not received any email for this so only just seen it!

    Anyways – on to your enquiry. You can disable the score completely in the new setting page. That should prevent it showing and being handed to the tweet/post.

    If however you did want the score to display in the page title then it gets more complex.

    The plugin does drop the score into the search results post object so something like this might work.

    if (is_search() && in_the_loop()) {
        if (isset($post->ssrch_relevance_percent)){
            echo "<span class='score'>" . number_format(($post->ssrch_relevance_percent*100),0) ."%</span>";
        }
    }

    You could probably even ditch the outer loop/search check and rely on isset.

Viewing 1 replies (of 1 total)
  • The topic ‘Remove Score from the_title_attribute()’ is closed to new replies.