Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Using it for a Child Theme errors #11

Closed
GerritKuilder opened this issue Feb 23, 2012 · 8 comments
Closed

Using it for a Child Theme errors #11

GerritKuilder opened this issue Feb 23, 2012 · 8 comments

Comments

@GerritKuilder
Copy link

in library/admin.php:

echo '';

In the event a child theme is being used, the parent theme directory Path will be returned, use get_stylesheet_directory() to get the child theme directory Path.

There might be more issues with it as I could not find a reference to style.css, only the minified versions.

@chrisbarnes
Copy link
Collaborator

@GerritKuilder Can you provide a little more detail for this one?

@GerritKuilder
Copy link
Author

If you try to set up a child theme with this theme you get a few errors:

require_once([...]\wordpress/wp-content/themes/bootstrapChild/admin/options-framework.php

See http://codex.wordpress.org/Function_Reference/get_stylesheet_directory
http://codex.wordpress.org/Child_Themes
a child theme has the advantage of making additional changes to a theme without the need to modify the original code.

Also the style.css of a child theme is used to pull in the theme css's and I think at the moment this does not happen.

I don't know how it will work in regards in pulling in lib stuff if they are also in a child theme.

I think it is best I make a separate wordpress setup for this and see how far I can get.

@GerritKuilder
Copy link
Author

Looked at the latest download and had issues with the admin part:

changed code: in options-framework.php, the only way to get it to work.

if ( STYLESHEETPATH == TEMPLATEPATH ) {
define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('template_directory') . '/admin/');
} else {
define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('template_directory') . '/admin/');
}
require_once (get_template_directory() . '/admin/options-framework.php');

Changed the header.php: lots of styles (css/js) where hardcoded to the template directory. For child themes this is not very convenient. Most styles use only wp_head function and add_action(wp_head,....).
Could not find the details..... but most likely doe some clever stuff to see if a child theme is used and/or files exist.

As the bootstrap.css set some backgrounds it would be convenient to be able to override all css/js etc in a child theme. (although a better solution would be to import them in child/style.css)

header.php:


Site: devel.kuilder.net/bootstrap

@Synchro
Copy link

Synchro commented Feb 28, 2012

I've run into this too. For now I've worked around it like this:

  • Created symlinks to the admin and library folders in the master theme in the child folder
  • Changed this in Header.php:
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
    
    
Then imported the master style sheet from inside my child theme's style.css.
This is all very hacky though, not a proper fix!

@chrisbarnes
Copy link
Collaborator

Please have a look at the latest commit and let me know how things work.

@Synchro
Copy link

Synchro commented Mar 1, 2012

I've confirmed that it now works as a child theme, without the symlinks I created before. This is great as it now means I can just git pull in the master theme folder and not worry about breaking anything. Thanks for pushing the fix.

@chrisbarnes
Copy link
Collaborator

@Synchro Great news! Please let us know if you see any issues.

@GerritKuilder
Copy link
Author

So far So Good, nice

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants