mgsisk / inkblot

Inkblot is an elegant, fully responsive, highly customizable Webcomic-ready WordPress theme.
http://wordpress.org/themes/inkblot
45 stars 11 forks source link

Inkblot child issue #13

Closed nirurin closed 11 years ago

nirurin commented 11 years ago

Me again... I seem to be coming up with all the problems at the moment.

I've started making changes to my sites theming, layout and colours and things like that. So that I dont end up losing it all during an update, I followed the codex and made myself a child theme file style.css.

As far as I am aware, what I should do is

  1. create a style.css file, with the appropriate formatting for a child theme. (see below)
  2. Put in an @import to the inkblot parent
  3. Install it as the theme and activate.

..and this should show up the website as it would on a default Inkblot theme, except including any changes that is in the new childs style.css. I used the style.css that was given in this support question on here: https://github.com/mgsisk/inkblot/issues/9

Except changed slightly, as my inkblot file is still called "Inkblot-master".

From what the wordpress codex says, at least from what I understand, this should show up the standard default Inkblot formatting, but with one difference : the background colour changing.

However instead it seems to completly remove all formatting...

I cant seem to find a way to replicate this by searching the help sections of other themes, as they all seem to suggest this should work?

/*
Theme Name: inkblot - niruchild
Description: Child theme for Inkblot
Author: nirurin
Template: inkblot-master
Version: 0.1
Webcomic: 4
*/

/** Load parent theme's style.css */
@import url("../inkblot-master/style.css");

#header {
background:#fafafa;
}
mgsisk commented 11 years ago

The solution described in #9 no longer works because of changes in how Inkblot loads CSS files. Previously, three separate files were loaded: -/css/normalize.css, styles.css, and a dynamically generated CSS file based on your theme customizations (in that order). Newer versions of Inkblot actually merge these three files into a single composite file which is constructed from -/css/normalize.css, styles.css, the theme customization styles, and custom.css.

CSS requires any @import rules appear before any style rules, but because of how Inkblot generates the composite stylesheet it's actually impossible for your @import rule to be at the top of the final CSS file (unless you add it to the top of -/css/normalize.css, which isn't a good idea).

Because of this new setup you actually need to copy Inkblot's style.css and custom.css files into the child theme, then tweak the style.css header (adding the Template: inkblot bit and so on) and put all your custom styles into custom.css (which is loaded after the theme customization styles to ensure that your styles take precedence).

nirurin commented 11 years ago

Ahh ok I see... so if I understand this correctly, I dont actually need to bother making a child theme? All I need to do is add my customisations to the Inkblot custom.css file, as long as I keep a copy of that file somewhere else whenever I do an update of the master inkblot files? Although doing a child theme may be safer in the long run, especially as I have some things i need to add to the functions.php file as well.

mgsisk commented 11 years ago

You could do it that way, but if you're changing anything besides the CSS a child theme is probably the way to go.

nirurin commented 11 years ago

Ok, well once again thankyou, your help has been very much appreciated!

gfcmedia commented 11 years ago

I just updated to Inkblot 4.0.2 and noticed my child themes broke. I'm glad someone else updated before I did, so now I know how to fix them. :+1: Thanks!

pixelmostaza commented 11 years ago

Hi, I checked this thread before deciding to use a child theme, and while I can use the method shown here to get the CSS working, the php files in my child theme are being ignored by those in parent theme.

How can I make it so that the child theme php files override the parent theme's?

mgsisk commented 11 years ago

That's just how WordPress works, actually. For example, if you create a single.php template in your child theme's directory WordPress will use that template instead of the parent themes single.php template. If that isn't working I can only assume something is either wrong with your child theme or WordPress itself. Are there specific templates you're having issues with?

pixelmostaza commented 11 years ago

Yes, the templates I'm having issues with seem to all be in the webcomic directory. 'webcomic/content.php' and 'webcomic/home.php'.

I created a files with the same name, but for instance in the case of webcomic/content.php, there also a content.php outside of the webcomic directory in the parent theme.

Is there a way to force the override of files in my child theme's functions.php?

mgsisk commented 11 years ago

The webocmic/*.php template files are only used when Webcomic is active; otherwise, the normal template files are used. There are ways to force overriding template files, but I'm pretty sure something else is wrong here because WordPress is designed to use a child themes template files instead of the parent themes; it should be happening automatically. Is your child theme the active theme for the site?

pixelmostaza commented 11 years ago

Yes, the child theme is currently activated and the style.css has been created properly. I should say I'm running a multsite install (don't know if that makes any difference, but other child themes in the past have worked without issues).

I also experienced this same issue while trying to create a child theme with Comicpress. Never found a solution to that one either.

mgsisk commented 11 years ago

A network (or multisite) shouldn't have any effect on child themes. Just to be sure, though, I went ahead and switched my devbox to a network setup and tested both Inkblot and ComicPress child themes. Both worked as expected for both the main network site and sub sites. Activating the themes normally or network-enabling them didn't change anything, and they continued to work properly after disabling their parent themes but allowing the child themes. They even continued working when the child themes themselves were disabled from being activated (since the sites already had them set as the active theme, though, WordPress kept using them).

Even if Inkblot and ComicPress are the only themes that have issues on your network setup I'd still wager there's something weird going on somewhere with the network itself. I couldn't point you in any helpful direction for figuring out what that might be, unfortunately. For Inkblot, I'd double check to make sure Webcomic is active on whatever sites you're trying to use the Inkblot child theme (especially if it's just webcomic/*.php template files that aren't loading).

pixelmostaza commented 11 years ago

Oh hell yeaaah! Got it working after deleting my cache and cookies. That's a first, but it did the trick. :) Thanks!!!