0

Hi I'm writing a plugin to include custom search results. I'm not really allowed to edit any theme pages, but the search results page in twentyfourteen's search.php seem hardcoded to me:

        <header class="page-header">
            <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyfourteen' ), get_search_query() ); ?></h1>
            <?php if (function_exists("getGlossarySearchResults")) { echo getGlossarySearchResults(); }  ?>
        </header><!-- .page-header -->

I have to display the results before the normal search results. So is there any way modify the results output header from code?

1
  • 1
    Why don't you just create a child theme and then do your changes in there Commented Apr 25, 2014 at 11:00

2 Answers 2

0

No but I suggest you create a child theme, this will give you full control over the site without affecting the original theme... in there you can create a functions.php page and customize the search from there.

you can search for a child theme plugin that can create it for you, and some of them include editors...

3
  • I suggested the same in comments already. To make your answer useful, please add some links that support your suggestions, preferably something from the codex. As it currently stands, your answer should actually be a comment Commented Apr 25, 2014 at 11:09
  • Sorry noob to this... can i promote the plugins that I use? Commented Apr 25, 2014 at 11:15
  • You cannot promote, bu you can suggest. You can change "you can search for a child theme plugin that can create it for you" to "I use some plugin to create my child themes for me" Commented Apr 25, 2014 at 11:22
0

Under the assumption that you just need your custom search results to show up on the search results page, you'll want write the function that will insert your customized results after an if is_search() statement like so:

if (is_search()){
    //code that retrieves or displays your custom search results
    }

The code that will retrieve or display the custom search results will vary depending on what these custom results are.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.