child theme for metal

Latest Reply from Alice at 2015-10-21 02:44:04
hi, i created a child theme for "metal" template... function.php works well, and so other files... but the style.css not working... any modification i make will have no effect... and so the various files present in the /css folder...
how can i do ?
thanks in advance !
Hi!

Have you activated child theme on the page Appearance --> Themes in the dashboard of the website?
of course i actived it... as i wrote:
"function.php works well, and so other files... but the style.css not working... any modification i make will have no effect... and so the various files present in the /css folder..."

please, how can i solve ?
please, do you have some suggestion about this issue ?
thanks in advance !

Hi!
Probably, you missed some points - follow the instruction:
https://codex.wordpress.org/Child_Themes.
Perhaps, you forgotten to add the code:
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

}
to your functions.php file or created your child theme's stylesheet wrong.
when i created child theme i referred to wordpress manual, i followed all the point, as the modification of function.php
this is the style.css i created: but the modification not works...


/*
Theme Name: metal-child
Template: metal
*/


/*------------------------------ MENU ------------------------------*/
#secondarymenu-container {
height: 90px; //EDITED: 143px
position:relative;
z-index:11;
}
According to the instruction you need to create other header for child theme's stylesheet. View this example::
/*
Theme Name: Metal Child
Theme URI: http://example.com/metal-child/
Description: Metal Child Theme
Author: Me
Author URI: http://example.com
Template: metal
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: metal-child
*/
the header that you suggested was the first header i tried but it's not working... studying the wordpress manual i understood that only 2 lines of the header are mandatory... the other ones are optional.
As I said in the first mail, all other files like functions.php works well and that indicates that the child-theme is working, the only problem is on style.css so the problem could not be the header... anyway i just tryed out now and I confirm you that the header you suggested is not working... the problem must be something elsewhere
Hi!
I found out the reason for the problem.
What you need to do is use specific enough selectors so that your CSS will take precedence. Because CSS is read top-down, you usually only need to use the same selectors from the other style sheets (no matter which one) in your child theme -- and then change the styles in the copied CSS. For example, there is styles for secondary menu links:
#secondarymenu a {
padding:5px 9px;
font-size:10px;
color:#fff;
text-transform:uppercase;
}

To override this code you will have to add smth like this:
#header #secondarymenu a {
padding:5px 9px;
font-size:10px;
color:#fff;
text-transform:uppercase;
}

into your child style sheet. Read the following article about css rules: http://www.yourhtmlsource.com/stylesheets/advancedcss.html.
how to insert menus in theme ??? Thank you
Hi!
By default, there are two menus always visible on your screen, the "Main" menu and the "Top" menu. To customize any of them you have to go to the page Appearance => Menus and set the created menu as a main/top menu. Here are the intelligible instructions:
http://codex.wordpress.org/WordPress_Menu_User_Guide.
Removing the menus has been already discussed on our forum:
http://smthemes.com/support/topic/howcaniremovesearchboxmenusliderfacebookwidgetetc/#post-2326
(secondary) and
http://smthemes.com/support/topic/removecategorybar/#post-1217
(main menu).

Leave a reply

Add codeAdd image