• Resolved ZAxel

    (@zaxel)


    Hi,

    I am trying to create a child theme that includes a 404 page without the search function, but just creating a child theme removes the functionality of the pop-out menu and a lot of the formatting. Is there something specific I should be doing to preserve the original functionality and formatting of the theme?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Theme Author Hardeep Asrani

    (@hardeepasrani)

    Hi,

    First of all which version of Latte theme are you using? And could you you created a child theme (using Dropbox or something) so I could see?

    And also – please give me the link to your website. Thank you. 🙂

    Regards,
    Hardeep

    Thread Starter ZAxel

    (@zaxel)

    I am using version 0.6 of Latte.

    Here’s my site: graveofdankeep.cu.ma/wp/
    Currently the child theme is active.

    Here’s a Dropbox link to a .rar of my child theme: https://www.dropbox.com/s/7eshpcn3v80zvfo/latte-child.rar?dl=0

    Thanks!

    Theme Author Hardeep Asrani

    (@hardeepasrani)

    Hi,

    The following code should be in the functions.php file of your child theme, not style.css file:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    ?>
    
    <?php
    function theme_enqueue_styles() {
    
        $parent_style = 'parent-style';
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style )
        );
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    ?>

    Replace your functions.php file with this and remove all the code from style.css file, apart from the header with details and it will work. Let me know. 🙂

    Thread Starter ZAxel

    (@zaxel)

    I implemented the changes you suggested and now when I go to my website I get this message only:

    Fatal error: Cannot redeclare theme_enqueue_styles() (previously declared in /home/graveofd/public_html/wp/wp-content/themes/latte-child/functions.php:4) in /home/graveofd/public_html/wp/wp-content/themes/latte-child/functions.php on line 19

    Here is another Dropbox link to my edited child theme: https://www.dropbox.com/s/7eshpcn3v80zvfo/latte-child.rar?dl=0

    Thanks!

    Theme Author Hardeep Asrani

    (@hardeepasrani)

    Just replace the functions.php file with the following code:

    <?php
    
    function latte_child_enqueue_styles() {
    
        $parent_style = 'parent-style';
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style )
        );
    }
    add_action( 'wp_enqueue_scripts', 'latte_child_enqueue_styles' );
    
    remove_filter('template_redirect', 'redirect_canonical');
    ?>

    You added the same function twice which was the issue. 🙂

    Thread Starter ZAxel

    (@zaxel)

    Thanks, it’s working now!

    Theme Author Hardeep Asrani

    (@hardeepasrani)

    Glad to know. Don’t forget to check out Latte Pro: http://www.hardeepasrani.com/portfolio/latte/

    Have a great week. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Child Theme/404 Issues’ is closed to new replies.