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!
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!
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!
Glad to know. Don’t forget to check out Latte Pro: http://www.hardeepasrani.com/portfolio/latte/
Have a great week. 🙂