how to link child theme to child style-mobile.css

  • Author
    Posts
  • #23868
    Yehonatan Naim

    Hi,

    How do I make mantra to link style-mobile.css which I have in my mantra-child?

    I made a theme child which work well, but when I move to mobile resolution I see the the css point to the file /mantra/style-mobile.css and not /mantra-child/style-mobile.css

    Thanks in advanced,
    Yehonatan Naim.

    #23940
    Yehonatan Naim

    OK,
    I solved this issue…. alot of digging 🙂

    bottom line, in the Includes dir there is a theme-styles.php file which use the following line to get the style-mobile.php file:

    if($mantra_mobile==”Enable”) { wp_register_style( ‘mantra-mobile’, get_template_directory_uri() . ‘/style-mobile.css’ );}

    using get_template_directory_uri() function override the theme-child.
    in order to refer the theme-child should use get_stylesheet_directory_uri() function..

    I add to my theme-child the style-mobile.php file with the right function

    if($mantra_mobile==”Enable”) { wp_register_style( ‘mantra-mobile’, get_stylesheet_directory_uri() . ‘/style-mobile.css’ );}

    now its work 🙂

    #23942
    Yehonatan Naim

    Sorry I wrote the file name wrong… should be theme-styles.php instead of style-mobile.php 🙂

    OK,
    I solved this issue…. alot of digging 🙂

    bottom line, in the Includes dir there is a theme-styles.php file which use the following line to get the theme-styles.php file:

    if($mantra_mobile==”Enable”) { wp_register_style( ‘mantra-mobile’, get_template_directory_uri() . ‘/style-mobile.css’ );}

    using get_template_directory_uri() function override the theme-child.
    in order to refer the theme-child should use get_stylesheet_directory_uri() function..

    I add to my theme-child the theme-styles.php file with the right function

    if($mantra_mobile==”Enable”) { wp_register_style( ‘mantra-mobile’, get_stylesheet_directory_uri() . ‘/style-mobile.css’ );}

    now its work 🙂

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘how to link child theme to child style-mobile.css’ is closed to new replies.