March 30th, 2020 at 01:30 #100598
I’ve been playing around with the Nirvana-theme for a hobby project, and it’s been pretty fun so far 🙂
I formed a child theme based on Nirvana and tweaked around a bit. Mostly just replacing different strings of text in the UI. I was tweaking some of the text present in the search, and then I tried editing the “Search results for”- string (pictured):
It seems to be nested within the “nirvana_breadcrumbs”-function, within includes/theme-functions.php . I tried replicating this filepath within my child-theme and then editing in my changes, but it seems that any changes I enact within the includes-path is not coming to effect.
So far I’ve managed to tweak what I’ve wanted to within the root of my child-theme, but I’m unsure why my changes within includes/theme-functions.php . But this particular string seems to be a tough nut to crack 😀
I tried searching for a solution, but it didn’t look like anyone else ran into this particular issue. Any help would be greatly appreciated! 🙂April 4th, 2020 at 00:20 #100866ZedCryout Creations mastermind
There are two almost identical strings in the theme. One is used on the search page title (and has the %s placeholder in it), the second one is used in the breadcrumbs (and doesn’t use the placeholder).
Look only for Search results for and don’t include a trailing space.April 12th, 2020 at 18:21 #101223
Greetings, Mr. Zed.
Thank you for taking the time to reply!
I searched the files for strings that contained Search results for, without any extra inputs or special symbols. And I indeed found two very similar strings with these phrases.
The first string (the one with the %s placeholder) I managed to replace the text within my child theme successfully. This was situated within /search.php .
The second string (located within the breadcrumb) is the string that I am trying to change, but I am unable to alter via my child theme, however. This one is situated within /includes/theme-functions.php .
Originally I tried to change it by replicating the filepath within the child-theme, and then trying the change the string that way. This however didn’t work. I can edit the string within the original theme’s files, but I would prefer not to tamper with the original theme.
It is likely that I am missing something, but I am unsure what the best approach is within a child theme. If there is a better way, I’d love to know it 😀April 26th, 2020 at 15:37 #101918ZedCryout Creations mastermind
You don’t need to use a child theme to edit strings, you can do that using translations directly, as suggested here: https://www.cryoutcreations.eu/wordpress-tutorials/editing-theme-strings-translations
The topic ‘Editing the “Search results for:” string via child theme?’ is closed to new replies.