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?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #278995

    Xristos
    Participant

    Hello, 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.php

    But 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?

    #279072

    Hello,

    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

    #279176

    Xristos
    Participant

    Hello 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.
    #279340

    Hello,

    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

    #279515

    Xristos
    Participant

    Hello, 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.
    #279662

    Hello,

    Please provide your site admin access to the private area.

    Best Regards

    #279743

    Xristos
    Participant

    Here you can see the Error. https://wave.webaim.org/

    Just let me know what changes you will make.

    Thank you!

    #280095

    Hello,

    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

    #280098

    Xristos
    Participant

    Hello,

    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 label

    Code without Comment
    Message from https://wave.webaim.org
    3x Multi form labels

    I remove the comment, you can check it.

    Thank you.

    #280595

    Hello,

    Please remove: <label for="s">Αναζήτηση</label> and insert aria-label="Αναζήτηση" to the input and error would be fixed: http://prntscr.com/1181h0s

    Best Regards

    #280685

    Xristos
    Participant

    It worked!

    Thank you.

    #280995

    We 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

Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)

The topic ‘How can I override that specific file in my child theme?’ is closed to new replies.