milohuang / reverie

Reverie is a versatile HTML5 responsive WordPress framework based on ZURB's Foundation.
http://theakiba.com/reverie/
MIT License
916 stars 196 forks source link

Child theme CSS #2

Closed shrwnsan closed 12 years ago

shrwnsan commented 12 years ago

Hello. Nice work.

I was trying to do a child-theme to keep the main one in tact. Seems it doesn't support it? (just me or anyone else getting this issue?)

shrwnsan commented 12 years ago

Sorry, I should have stated that this is more specifically towards the style.css file.

Doing this still works @import url('../reverie/style.css'); just thought it would do a link.rel on the html markup like Roots. Hope that clarifies it.

TIA

milohuang commented 12 years ago

Just took a look at Roots theme (in their roots-actions.php line 111). They seem to apply a custom function to automatically input the HTML markup for the style.css for child theme. You can do the same thing but the reason that I didn't include is because 99% of the CSS, JS and other fancy stuffs are done by Foundation, thus I don't think the users will use the style.css to build their child theme.

shrwnsan commented 12 years ago

I see. Can you point me in the right direction on how to do that? Just wish it was easier to add custom style sheets along reverie. That is, it would be nice to have something like this at least:

<link rel="stylesheet" href="http://justamemo.com/wp/wp-content/themes/reverie/style.css">

<!-- Included Foundation CSS Files -->
<link rel="stylesheet" href="http://justamemo.com/wp/wp-content/themes/reverie/css/foundation.css">
<link rel="stylesheet" href="http://justamemo.com/wp/wp-content/themes/reverie/css/app.css">

<!-- Included Custom CSS File(s) -->
<link rel="stylesheet" href="http://justamemo.com/wp/wp-content/themes/reverie_jam/style.css">
shrwnsan commented 12 years ago

I took a look at the roots-actions.php file. I see what you are looking at:

  if (is_child_theme()) {
    $styles .= stylesheet_link_tag('/style.css', 1);
    $styles .= "\t<link rel=\"stylesheet\" href=\"" . get_stylesheet_uri(). "\">\n";
  } else {
    $styles .= stylesheet_link_tag('/style.css', 1);
  }

I'll add this to the child theme's header.php. With some edits of course. Unless there's another way? Please do tell. TIA

shrwnsan commented 12 years ago

Just did the following in the Child theme's header.php if anyone else can use it in the same situation. HTH

    <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/style.css">

    <!-- Included Foundation CSS Files -->
    <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/foundation.css">
    <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/app.css">

    <?php if (is_child_theme()) { ?>
    <!-- Include Child theme CSS file -->
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
    <?php } ?>