Home › Forums › WoodMart support forum › How can I override that specific file in my child theme?
How can I override that specific file in my child theme?
- This topic has 11 replies, 2 voices, and was last updated 3 years, 8 months ago by Elise Noromit.
-
AuthorPosts
-
April 5, 2021 at 12:36 pm #278995
XristosParticipantHello, I want to customize the file public_html/wp-content/themes/woodmart/inc/modules/search.php
I tried to copy the search.php from the parent theme into the child theme
public_html/wp-content/themes/woodmart-child/inc/modules/search.phpBut didn’t work.
(Notice that when I change the file in the parent theme the changes work, but when I do the changes into the child theme it didn’t work).My question is: How can I override that specific file in my child theme?
April 5, 2021 at 6:11 pm #279072
Elise NoromitMemberHello,
Search is the Woocommerce functionality and our support does not cover customization of the Woocommerce, please advise what is the purpose of the customization, what features you want to get, perhaps the theme has or we may suggest a plugin.
Best Regards
April 6, 2021 at 7:09 am #279176
XristosParticipantHello Elise,
Let me explain what I want to do.
I want the website to pass the tests without errors in the following websites:
#1. https://wave.webaim.org/
#2. https://validator.w3.org/I correct a lot of errors but I am stuck at an Error with a Missing form label see picture.
I find that I should add a <label> tag and the code will be in the file public_html/wp-content/themes/woodmart/inc/modules/search.php
<label for="s">Search</label> <input type="text" class="s" id="s" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php echo get_search_query(); ?>" name="s" />
But if I will make an update the file will be overridden, that’s why I want to put it inside the child folder.
I don’t want you to make any customization for me, I know the changes inside the code.
I want to put the code inside of the child theme so it will not be overridden after an update.
How can I do that?Thank you.
Attachments:
You must be logged in to view attached files.April 6, 2021 at 1:00 pm #279340
Elise NoromitMemberHello,
Please take this file:
woodmart/inc/modules/search.php
Copy this function http://prntscr.com/115qizp and insert it into the functions.php of the child theme.
Best Regards
April 7, 2021 at 8:21 am #279515
XristosParticipantHello, it works after I insert the code into the function.php as you told me.
But now I am facing multiple form labels error, do you have any suggestion? (See picture)
The search form code appears for some reason 3 times. (I think the one is on mobile view).The
Thank you.
Attachments:
You must be logged in to view attached files.April 7, 2021 at 12:36 pm #279662
Elise NoromitMemberHello,
Please provide your site admin access to the private area.
Best Regards
April 7, 2021 at 2:00 pm #279743
XristosParticipantHere you can see the Error. https://wave.webaim.org/
Just let me know what changes you will make.
Thank you!
April 8, 2021 at 10:20 am #280095
Elise NoromitMemberHello,
You have commented on the code where you added the label in the child theme and as a result, you have this error.
If you have any questions please feel free to contact us.
Best Regards
April 8, 2021 at 10:28 am #280098
XristosParticipantHello,
Yes, I know. I comment on the code because not solve my problem.
Code with Comment
Message from https://wave.webaim.org
3x Missing form labelCode without Comment
Message from https://wave.webaim.org
3x Multi form labelsI remove the comment, you can check it.
Thank you.
April 9, 2021 at 8:55 am #280595
Elise NoromitMemberHello,
Please remove:
<label for="s">Αναζήτηση</label>
and insertaria-label="Αναζήτηση"
to the input and error would be fixed: http://prntscr.com/1181h0sBest Regards
April 9, 2021 at 10:50 am #280685
XristosParticipantIt worked!
Thank you.
April 9, 2021 at 9:18 pm #280995
Elise NoromitMemberWe are always happy to help you, write to us when you have any difficulties or issues with our theme.
We would be grateful for 5 stars rate on http://themeforest.net/downloads in case you are satisfied with our theme and customer service
Thank you in advance
-
AuthorPosts
Tagged: child-theme
The topic ‘How can I override that specific file in my child theme?’ is closed to new replies.
- You must be logged in to create new topics. Login / Register