Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #33609
    prajakta
    Member

    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

    #33672
    Sakin
    Keymaster

    @prajakta: This is simple. So, you want to remove the Catch Kathmandu theme responsive.css file and then add your own responsive.css file in your child theme. Then first, create blank functions.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 );
    #36293
    prajakta
    Member

    Thanks for the reply…it’s working.

    #58363
    effess
    Participant

    Is 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.)

    #58380
    Sakin
    Keymaster

    @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.

    #58673
    effess
    Participant

    Site 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!

    #58690
    Sakin
    Keymaster

    @effess: You can add in as below:

    @media screen and (max-width: 1152px) {
    	#masthead .header-sidebar .widget ul.menu ul {
    		top: 30px;
    	}
    }
    #58733
    effess
    Participant

    This worked. Thank you!

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘How to use different responsive.css in child theme without changing parent theme’ is closed to new replies.