Title: Replace the_title() code
Last modified: June 10, 2019

---

# Replace the_title() code

 *  Resolved [steve92](https://wordpress.org/support/users/steve92/)
 * (@steve92)
 * [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/)
 * I need to replace this code **the_title()** with this **relevanssi_the_title()**.
   Which file are they in?

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/#post-11630712)
 * Depends on your theme, but usually it’s search.php in your theme folder.
 *  Thread Starter [steve92](https://wordpress.org/support/users/steve92/)
 * (@steve92)
 * [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/#post-11630756)
 * Yes, I have 2 sites and I use 2 themes: _Donoval_ and _WP-portfolio_, but I can’t
   find the **the_title()** code
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/#post-11631541)
 * I can’t tell where it is, the exact place depends on the theme. If you have access
   to theme support, ask there.
 *  Thread Starter [steve92](https://wordpress.org/support/users/steve92/)
 * (@steve92)
 * [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/#post-11631889)
 * I did a search in the themes with BBEdit, but the **the_title()** code isn’t 
   there
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/#post-11632762)
 * I could not find any reference to a theme called Donoval. If you mean [Donovan](https://wordpress.org/themes/donovan/),
   it does use `the_title()`, and it’s in the `/template-parts/content-search.php`
   file.
 * In WP-Portfolio, the code is located in `/inc/structure/content-extensions.php`.
 *  Thread Starter [steve92](https://wordpress.org/support/users/steve92/)
 * (@steve92)
 * [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/#post-11633481)
 * Good. in Donovan theme `/template-parts/content-search.php` file line 16 I put`
   <? php relevanssi_the_title (sprintf (...)` and I selected ceckbox in WordPress
   admin setting relevanssi, then I typed an article title, the search found the
   article but did not highlight the name.
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/#post-11636617)
 * Actually, the correct file is `/template-parts/content-excerpt.php` and line 
   needs to be
 * `printf( '<h2 class="entry-title"><a href="%s" rel="bookmark">%s</a></h2>', esc_url(
   get_permalink() ), relevanssi_the_title( false ) );`
 *  Thread Starter [steve92](https://wordpress.org/support/users/steve92/)
 * (@steve92)
 * [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/#post-11637898)
 * Good.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Replace the_title() code’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [steve92](https://wordpress.org/support/users/steve92/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/replace-the_title-code/#post-11637898)
 * Status: resolved