• Resolved chaoscactus

    (@chaoscactus)


    Hello,

    I’m building a website that holds lots of content on it, and some of the pages are quite long.

    When I go to my search bar to look something up, it displays the entire page, and thus forth making it quite difficult to read.

    I’m not the strongest PHP coder, but I was wondering if anyone knew of a way to limit the amount of characters that appear in the search results page.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You could try editing your theme’s search.php template file and replacing <?php the_content();?> with <?php the_excerpt();?>.

    Thread Starter chaoscactus

    (@chaoscactus)

    Thanks! That definitely did the trick!
    Much appreciated.

    i dont have a search.php but instead, searchform.php….

    <div class=”searchform searchbox”>
    <form name=”search” method=”get” id=”searchform” action=”<?php bloginfo(‘home’); ?>” >
    <label class=”screen-reader-text” for=”s”>Search for:</label>

    <input type=”text” value=”Tablified App Searcher…” name=”s” id=”s” class=”s search_bg” onfocus=”if (this.value == ‘Tablified App Searcher…’) {this.value = ”;}” onblur=”if (this.value == ”) {this.value = ‘Tablified App Searcher…’;}” />
    <input type=”submit” id=”searchsubmit” value=”Search” class=”search_submit” />
    </form>
    </div>

    anyone know how i can do it with this theme i have installed?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do you limit search result characters?’ is closed to new replies.