Support » Themes and Templates » Include mobile-style.css to Child Theme

  • Hello folks!
    I have a question with a probably pretty simple answer, but I can’t get it right neither can I come up with the search terms which lead me to an answer.

    Well, I made some changes to a style-mobile.css and want to protect those from being overwriten using a child theme. I created a directory and a stlye.css, which is filled with this code:

     * Theme Name: Mantra Child
     * Theme URI:
     * Description: Mantra is a do-it-yourself WordPress theme, featuring a pack of over 100 customization options and easy to use tweaks capable of tuning WordPress to your very specific needs and likes. With the help of a simple and efficient user interface you can customize everything:the layout (1,2 or 3 columns), total and partial site widths, colors (all texts, links, backgrounds etc.), fonts (over 35 font-families plus all Google Fonts), text and header sizes, post metas, post excerpts, post formats, header and background images, custom menus, 27 social media links and icons, pins, bullets and much much more. With a fully responsive layout,a customizable showcase presentation page, animated slider, magazine and blog layouts, 8 widget areas, modern graphics and an easy and intuitive admin section, you can start creating your dream site right now.
     * Author: Cryout Creations, Child by Exciting Webdesign
     * Author URI:
     * Template: mantra
     * Version: 1.0
     * License: GNU General Public License v2.0
     * License URI:
     * Tags: black, red, blue, white, silver, light, dark, one-column, two-columns, three-columns, right-sidebar, left-sidebar, flexible-width, fixed-width, custom-background, custom-colors, custom-header, custom-menu, featured-image-header, featured-images, front-page-post-form, full-width-template,  microformats, post-formats, rtl-language-support,  sticky-post, theme-options, threaded-comments, translation-ready
     * Copyright (c) 2011-2012 Cryout Creations
    require_once( get_stylesheet_directory(). '/mobile-style.css' );"

    Is that how the child themes fetches the mobile-style.css from it’s chidl directory?

    When I use the child theme, the mobile site is displayed differently opposed to the original theme, also the theme looks broken on the big screen.

    Link to the website:

Viewing 2 replies - 1 through 2 (of 2 total)
  • esmi


    Forum Moderator

    You can’t use PHP in .css file. Try something like:

    @import: url(../mantra/mobile-style.css);

    thank you for your quick answer. Using the code you gifted me the site’s format still breaks. Would you like to have to images showing the difference? Would that help or should I post the style.css of the child theme again?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Include mobile-style.css to Child Theme’ is closed to new replies.