• Resolved adamovic

    (@adamovic)


    Hi,

    I installed the Neve child theme, which I downloaded here: https://docs.themeisle.com/article/985-how-to-create-a-child-theme-for-neve.

    I added a custom 404.php file in the child root folder but it doesn’t overwrite the main 404.php file. I’m not sure what I’m missing. I used to change Neve’s 404.php file after each theme update and everything worked fine but, of course, the idea is that I don’t have to do this with each update.

    Must I do something in the child functions.php?

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi @adamovic,

    If you place 404.php file in child theme it should overwrite the default 404.php file of the parent theme – I have just tried that and it works as expected.

    Can you provide more details about what is the current content of 404.php file in your child theme and screenshot of where is it placed?

    Thread Starter adamovic

    (@adamovic)

    Hi @bvytis

    I call for a custom page I designed for the 404 from the 404.php, that’s it. I’ve been doing the same thing before in the parent theme’s 404.php and it worked fine.

    Here’s the link to the file’s content and location (I’m using WP File Manager plugin):
    https://gamblineers.com/404/

    Hi @adamovic,

    Thanks for sharing the screenshot. Everything looks correct and the exact same thing works fine on my end.

    Try re-uploading the file or if you are able to test it on another instance try doing that and make sure it’s not related to this particular WordPress instance as we are not able to recreate the issue on our end.

    Also, just in case you decide to use Neve PRO in the future – the ability to modify 404 pages is built with Theme settings: https://docs.themeisle.com/article/1148-how-to-create-a-custom-404-page-in-neve-pro

    Let us know how it goes!

    Thread Starter adamovic

    (@adamovic)

    Hi,

    I tried re-uploading and tested the same child-theme with same 404.php file but it didn’t work there either. The thing is, when I tried adding a function to the child’s functions.php file, that didn’t work either. It seems to me I must have missed something very basic.

    I installed the child theme from the zip file and then manually added the 404.php file. That’s all I did, should I have done something else besides that?

    AC

    (@purplecodes)

    Themeisle Support

    Hi @adamovic,

    I did steps as you did.
    https://snipboard.io/DGL5Yu.jpg

    Tested it and it works. Can you share with us the codes inside the 404.php and will try to test it.

    Thread Starter adamovic

    (@adamovic)

    Hi AC,

    this is the code inside 404.php:

    <?php
    /**
     * 404 template.
     *
     * @package Neve
     */
    
    get_header();
    header( 'Location: https://gamblineers.com/page-404' );
    get_footer();
    
    ?>
    AC

    (@purplecodes)

    Themeisle Support

    Hi @adamovic ,

    Thanks for the details.

    I think you copied it from the parent theme to the child theme. By default, this will not work with Neve alone or the Neve child.
    This will only work with Neve Pro.

    You will need to create your own code or use a plugin like this one below:
    https://wordpress.org/plugins/custom-404-pro/

    Hope that helps.

    Thread Starter adamovic

    (@adamovic)

    Hi @purplecodes ,

    actually this same code worked when I wrote it in Neve’s original 404.php file.
    Right now, any changes I do in any child’s theme file don’t work. Not just 404.

    Hi @adamovic,

    I get your point and it should definitely work but it indeed looks like there is something wrong with the connection between your child theme and parent theme so my recommendation here would be to try to create a child theme again from scratch and check if it works as expected.

    The approach defined definitely works with the theme so there should be something specific for your instance or how child theme is created.

    Thread Starter adamovic

    (@adamovic)

    I uploaded the child theme again and I found out that there are certain things I still don’t understand.

    When I install the child theme I need to activate it. But if I do that then the parent theme is no longer active. Is that ok?

    And if that’s ok, I lose the custom CSS I have from the parent theme. I suppose I could just copy and paste the same css to the child theme and things should remain the same.

    But does the child theme receive updates from the parent theme as they are released even if the parent theme isn’t active? I assume child themes don’t have updates?

    Sorry for all the confusion but this is new to me and I didn’t find any useful information online on how to do this.

    Thanks!

    Hi @adamovic,

    When you create a child theme you basically extend the parent theme, so the parent theme doesn’t disappear.

    To make sure that you won’t lose anything you have on the parent theme you can use this plugin: Customizer Export/Import to export and import all of your changes you made in the parent theme. It is explained how to use it in our video tutorial: How to create a child theme.

    When you update the parent theme, the child theme will also be updated and everything will continue to work fine unless you have some code that will create a conflict with the update, but this is unlikely to happen.

    I hope you understand better now 🙂

    • This reply was modified 3 years, 8 months ago by Betty.
    Thread Starter adamovic

    (@adamovic)

    Thank you @betydbr , that helped 🙂

    I activated child theme, imported all custom settings and added the 404.php file and everything works!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘404.php in Neve child theme doesn’t overwrite the parent 404.php’ is closed to new replies.