Problems with highlight search terms plugin
-
I have added: .hilite { background-color:yellow } to my style.css and my index.php looks like this:
header stuff <body <?php body_class(); ?>> <div id="wrapper"> <!-- Header (image) --> <div id="header"> <a class="img" href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>" name="top"><img src= <?php echo get_bloginfo('template_directory') . '/images/logo.png'; ?> ></a> </div> <!-- Main page content--> <div id="content"> <!-- Breadcrumbs--> <div class="breadcrumbs"> <?php if ( !is_front_page() ) { //Don't display the breadcrumbs on the front page if(function_exists('bcn_display')) { bcn_display(); } } ?> </div> <div class="hentry"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <!-- Go through every page --> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <!-- Title of Page --> <h2 class="title"><?php the_title(); ?></h2> <!-- Posted by / edited by --> <div class="postmeta"> <span class="timestamp">Posted by <?php the_author(); ?> on <?php the_time('F jS, Y') ?>. Last modified by <?php the_modified_author(); ?> on <?php mdv_last_modified('F jS, Y'); ?>.</span> <br/><br/> </div> <!-- The Content of the Page --> <div class="entry"> <?php the_content(); ?> </div> <br /><br /> </div> <?php endwhile; ?> <?php else : ?> <!-- No Search results were found --> <?php if (is_search()) { ?> <div class="post single"> <h2>Nothing found!</h2> <p>Sorry, but we couldn't find anything related to your query! Please try again using a different search keyword. </p> <hr /> <a href=" <?php echo home_url(); ?>">Return to the main page</a> </div> <?php } ?> <?php endif; ?> </div> </div> footer stuff
Now when I search for something, results in the title get highlighted, but stuff in the content doesn’t as seen in this image:
https://i.imgur.com/7eHVA.jpgI added the “hentry” div for redundancy, just because I looked at the plugin code and it seems to work for the content div
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Problems with highlight search terms plugin’ is closed to new replies.