Tagged: child
- This topic has 6 replies, 4 voices, and was last updated 8 years, 11 months ago by Theme Horse Support Team.
-
AuthorPosts
-
October 21, 2015 at 11:34 am #38701JoParticipant
Hey guys,
I am really hoping that you can help me!
I need to upgrade the ultimate theme to Version 1.0.6. – therefore I tried to create a childtheme…What I have done so far:
1. create a folder: “ultimatechild”
2. creaty a style.css:
/*
Theme Name: ultimate child
Theme URI: http://XXX.de/
Description: Child theme for the ultimate theme
Author: J.L
Author URI: http://XXX.de/
Template: ultimate
Version: 1.0
Tags: light, dark, right-sidebar, responsive-layout
*/
@import url(“../ultimate/style.css”);3. create a functions.php:
<?php
/**
* Theme Name child theme functions and definitions
*//*—————————————————————————————————————————*/
/* Include the parent theme style.css
/*—————————————————————————————————————————*/add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );}
When I activate the child theme on wordpress, the Header is missing and the menue doesn’t work correctly…
Please tell what I need to do, I need to upgrade the ultimate theme and also wordpress in General 🙁
Best regards,
Jo
October 22, 2015 at 11:58 am #38752JoParticipantI solved the Problem! 🙂
October 23, 2015 at 2:53 am #38778Theme Horse Support TeamKeymasterThat’s great Jo
Thank you!
November 23, 2015 at 10:27 pm #39916timurberkParticipantHow did you solve the problem?
November 24, 2015 at 7:43 am #39925Theme Horse Support TeamKeymasterHi timurberk,
We have replied many times how to create a child theme. To create a child theme create a folder name ultimate-child inside wp-content-> themes-> (your folder name)
Create style.css file and add this below code/* Theme Name: Ultimate Child Theme Theme URI: https://www.themehorse.com/themes/ultimate Author: Theme Horse Author URI: https://www.themehorse.com Version: 1.0 License: GNU General Public License, version 3 (GPLv3) License URI: http://www.gnu.org/licenses/gpl-3.0.txt Text Domain: ultimate Template: ultimate */ @import url("../ultimate/style.css");
So that your child theme is create.
Thank you!
December 7, 2015 at 5:45 pm #40262brunoParticipantHello,
As codex say, it seems that @import is not the best way to import css :
The final step is to enqueue the parent and child theme stylesheets. Note that the previous method was to import the parent theme stylesheet using @import: this is no longer best practice. The correct method of enqueuing the parent theme stylesheet is to add a wp_enqueue_scripts action and use wp_enqueue_style() in your child theme’s functions.php.
So how would you suggest to change the way to import css as it is not very clear for me ?
Thank you.
December 8, 2015 at 11:08 am #40279Theme Horse Support TeamKeymasterHi bruno,
As @import is the easy way to import css for the user which does not have any issue using this. For the developers who submit ticket in wordpress.org also use this way to import css. Yes you can import using hook too. Using hook is the best and the latest way to import css. If you are familier with code then you can use hook to import the css.
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); }
For more info you can visit here too
I will suggest that if you are good at coding then you can use action hook otherwise using @import would be ok.
Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.