Tagged: child theme, css, responsive
- This topic has 7 replies, 3 voices, and was last updated 8 years, 10 months ago by effess.
-
AuthorPosts
-
June 5, 2014 at 5:09 pm #33609prajaktaMember
I am using catch-kathmandu theme. I have created child theme.I have made certain changes to responsive.css(css/responsive.css). I want my child theme to use this changed css.For this i had to change one line in my parent theme inc/catch-kathmanu-functions.php(changes in catchkathmandu_scripts()). Can i do this without making any changes to parent theme.
I think catchkathmandu_scripts () could be overwritten if function_exists was used.Can we do this in future versions ? or is there any way out
June 6, 2014 at 1:27 am #33672SakinKeymaster@prajakta: This is simple. So, you want to remove the Catch Kathmandu theme
responsive.css
file and then add your ownresponsive.css
file in your child theme. Then first, create blankfunctions.php
in your child theme and add the following code.<?php /** * Catch Kathmandu Child functions and definitions */ // Remove Parent theme responsive.css and adding new responsive.css in child theme function catchkathmandu_child_enqueue_scripts() { wp_dequeue_style( 'catchkathmandu-responsive' ); wp_enqueue_style( 'catchkathmandu-child-responsive', get_stylesheet_directory_uri() . '/responsive.css' ); } add_action( 'wp_enqueue_scripts', 'catchkathmandu_child_enqueue_scripts', 11 );
June 25, 2014 at 8:01 pm #36293prajaktaMemberThanks for the reply…it’s working.
May 26, 2015 at 9:51 pm #58363effessParticipantIs there a way to use a responsive.css file in the catch-kathmandu-pro-child folder WITHOUT removing the original responsive.css from the parent theme? (I only have 2 lines of type to change so don’t want the entire code in the child folder.)
May 27, 2015 at 1:38 am #58380SakinKeymaster@effess: Yes, then you don’t need to change anything. You can just add your additional responsive css in your child theme style.css. Let me know what are you trying to do it, send me your site URL and css that you want to add in.
May 31, 2015 at 9:58 pm #58673effessParticipantSite isn’t online yet, but from responsive.css I want to change @media screen and (max-width: 1152px)
.header-sidebar .widget ul.menu ul { top: 30px; } Thanks!
June 1, 2015 at 9:05 am #58690SakinKeymaster@effess: You can add in as below:
@media screen and (max-width: 1152px) { #masthead .header-sidebar .widget ul.menu ul { top: 30px; } }
June 1, 2015 at 8:19 pm #58733effessParticipantThis worked. Thank you!
-
AuthorPosts
- The topic ‘How to use different responsive.css in child theme without changing parent theme’ is closed to new replies.