WordPress.org

Ready to get started?Download WordPress

Forums

[Theme: Focus] Child theme not importing parent styles. (9 posts)

  1. jonah.free
    Member
    Posted 1 year ago #

    As far as I can tell the problem is that the @import url is searching for the styles.css in /focus-child/focus (which doesn't exist). Instead it should be searching in just /focus.

    The php in the header in the child theme is

    <style type="text/css" media="screen">
    @import url(<?php echo get_stylesheet_directory_uri(); ?>/style.css);
    <?php if(get_option('custom_css')) { echo get_option('custom_css'); } ?>
    </style>

    And this results in

    <style type="text/css" media="screen">
    @import url(http://www.3dprint-uk.com.3dprint-uk.co.uk/wp-content/themes/focus-child/style.css);
    </style>

    in the source which seems fine to me.

    However the next line in my chrome inspect element tool is
    GET http://www.3dprint-uk.com.3dprint-uk.co.uk/wp-content/themes/focus-child/.../focus/style.csss 404 (Not Found)

    My style.css in my child theme is

    /*
    Theme Name: Focus-Child
    Theme URI: http://www.cadengrant.me/themes/focus
    Description: Premium Portfolio/Photography WordPress Theme
    Author: Caden Grant
    Author URI: http://www.stunningwp.com/
    Template: focus
    License: GNU General Public License version 3.0
    License URI: http://www.gnu.org/licenses/gpl-3.0.html
    Version: 1.0
    Tags: dark, theme-options, custom-menu, white, black, one-column, two-columns, three-columns, four-columns, custom-colors, custom-background, photoblogging, threaded-comments, theme-options, light, red, silver, tan
    */
    
    @import url("../focus/style.css");

    What have I done wrong?

  2. jonah.free
    Member
    Posted 1 year ago #

    just noticed a typo - should say style.css not .csss in the inspect element results.

  3. jonah.free
    Member
    Posted 1 year ago #

    By the way, I have my child-theme working using twenty-twelve. Seems to be a problems with the Focus theme and get_template_directory_uri() vs get_stylesheet_directory_uri(). I replaces the get templates with get stylesheets in the header. Halp!

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Where did you download the parent theme from?

  5. jonah.free
    Member
    Posted 1 year ago #

    Not sure exactly because I am working on it for a friend, but this is the theme http://themeforest.net/item/focus-minimal-wordpress-theme/3293567

  6. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 1 year ago #

    Have you contacted your theme's vendors regarding this?

  7. jonah.free
    Member
    Posted 1 year ago #

    My friend tried in the past but got no response. The vendor is not very active in dealing with support.

  8. Hopefully you're dealing with the correct Themeforest author link.

    http://themeforest.net/user/CadenGrant

    We can assist with some CSS and with generic WordPress function advice but the original theme's PHP files are not available to us.

    To be honest we don't want access either as we do not support commercial products here.

    That author link really is your best venue for that theme's support.

  9. jonah.free
    Member
    Posted 1 year ago #

    Ah ok, I didn't realize. Thanks for your help anyway.

Topic Closed

This topic has been closed to new replies.

About this Topic