-
AuthorPosts
-
March 30th, 2020 at 01:30 #100598
Greetings,
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 mastermindThere 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.
If you like our creations, help us share by rating them on WordPress.org.
Please check the available documentation and search the forums before starting a topic.April 12th, 2020 at 18:21 #101223Greetings, 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 mastermindYou 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
If you like our creations, help us share by rating them on WordPress.org.
Please check the available documentation and search the forums before starting a topic. -
AuthorPosts
The topic ‘Editing the “Search results for:” string via child theme?’ is closed to new replies.