clovis
Member
Posted 3 months ago #
When the search results come up on my site, at the end of the excerpts there is the text: "continue reading" which I want to change to something else.
I'm using twentyeleven theme with a child theme. Is it possible to change this text simply by putting something in the style.css in my child theme folder? Thanks! (and apologies if this is a stupid question!)
No - you would need to create a custom contents.php template file in your child theme.
clovis
Member
Posted 3 months ago #
Do I need to put any other php files in the child theme folder (at the moment I have only style.css), or can I just save a new file as contents.php, paste in the relevant php code (which I guess I can find with Firebug) and then change the wording, and put that in the child theme folder?
You can just put a new modified copy of the contents.php file in your child theme directory.
Unless you need to modify other files (sounds like you don't) then you'll only have style.css and contents.php in that directory.
clovis
Member
Posted 3 months ago #
Thanks @esmi @Jan I read somewhere that you can't use the exact same code in both the functions.php of the parent and of the child theme (otherwise you get an error message?)..is that true of content.php? Does that mean I should save a blank file (save it as content.php) and then just put the small amount of php code in that relates to 'search results' 'continue reading' text (whatever that code is), and then modify it, or should I make an entire copy of content.php in the parent file and then put that in the child theme folder (e.g. which has all the parent php code) and just modify the bit of that code I want to change? Thanks!
clovis
Member
Posted 3 months ago #
Interestingly (or, at least for a novice), when I put a blank content.php file in my child theme folder, the 'search' seems to work, but it no longer 'finds' anything on the site (even though I enter a search term I know is there and it used to find) and the message changes: it says- 'nothing found' in some browsers, or else, "search results for: ..." with no results (instead of bringing up excerpts and the 'continue reading' text/link). However, when I deleted the blank "content.php" from the child theme folder, the old search message is back (including 'continue reading') and it 'finds' my search term items again.
I read somewhere that you can't use the exact same code in both the functions.php of the parent and of the child theme (otherwise you get an error message?)
That's not strictly true. In Twenty Eleven (and many other child-friendly themes), you can rewrite many of the same function in the child's functions.php file.
is that true of content.php?
No - you can safely have a copy of contents.php in your child theme.
Does that mean I should save a blank file (save it as content.php)
I'd suggest that you make a copy of the parent's contents.php file in the child and then start modifying it.