• Resolved kshitizkoirala

    (@kshitizkoirala)


    I used the configurator to configure the child theme, The parent css are loaded and working fine but when I add my custom css to style.css or ctc-style.css nothing seems to work. What is the problem? If I try creating a new child theme while previewing the contents of my website, The designed images and texts are not loading instead the default theme with default template, texts and images are being loaded.

    My function.php is:

    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below:
    
    if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
        function chld_thm_cfg_locale_css( $uri ){
            if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
                $uri = get_template_directory_uri() . '/rtl.css';
            return $uri;
        }
    endif;
    add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
    
    if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
        function chld_thm_cfg_parent_css() {
            wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array(  ) );
        }
    endif;
    add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
    
    // END ENQUEUE PARENT ACTION
    

    Also I cannot find rtl.css in my child theme files? Is that necessary for the css to work.
    Here is my style.css

    /*
    Theme Name: Travel Agency Child
    Theme URI: https://rarathemes.com/wordpress-themes/travel-agency/
    Template: travel-agency
    Author: Kshitiz koirala
    Author URI: https://[email protected]
    Description: Travel Agency is a free WordPress theme to create travel online booking website for tour and travel operators and companies. You can add trips, destinations, and trip types, feature travel activities, highlight your specialties and allow visitors to book the trips. The stunning design combined with modern CSS effects and animation will make your visitors feel like they are already on a trip. Travel Agency WordPress theme is speed optimized, translation ready, SEO-friendly and mobile-friendly. Apart from travel booking companies, you can also use Travel Agency theme for travel blogging, hotel, spa, bed and breakfast, luxury resort, reservation, tour operator, tourism, transports and car booking. Check the demo at https://demo.rarathemes.com/travel-agency/, documentation at https://docs.rarathemes.com/docs/travel-agency/, and get support at https://rarathemes.com/support-ticket/.
    Tags: blog,one-column,two-columns,right-sidebar,footer-widgets,custom-background,custom-header,custom-menu,custom-logo,featured-images,threaded-comments,portfolio,rtl-language-support,translation-ready,theme-options
    Version: 1.2.5.1579089645
    Updated: 2020-01-15 17:45:45
    
    */
    
    body {
        display: none;
    }

    I also tried creating a custom child theme and the css works fine there but the database is not linked and he changes that I had made earlier to the theme is not shown at all. Instead a new template of that theme is loaded as said earlier which needs to be updated again. What is the problem with my child theme.

    I fixed the problem.
    AS SOON AS I CHANGED MY FUNCTIONS.php and pasted the code

    <?php
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
    
    function enqueue_parent_styles() {
       wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    }
    
    ?>

    The css started to work. But I couldn’t understand what was wrong before. Why was my database not imported? What was the error? Please help.

    The page I need help with: [log in to see the link]

  • The topic ‘Child theme css is enqueued but the additional css that i provide doesn’t work’ is closed to new replies.