Hot answers tagged parent-theme
4
Generally speaking, Child Themes were originally intended to be able to do two things:
Override parent Theme CSS
Override parent Theme template files
I doubt that the Theme developer intends for the /function-includes/theme-functions.php file to be overridden by a Child Theme. Functional files are usually a core component of the Theme, and allowing a ...
3
You can enable child themes for any theme:
http://codex.wordpress.org/Child_Themes
If you want your parent theme based off another parent theme, for example you want a theme based off of Twitter bootstrap and apply any changes they make to your framework, without over-riding your changes, use revision control.
Git
Mercurial
etc.
2
That's pretty simple:
You're trying to get the parent property from the $post object, but that is either NULL or simply not attached. In both cases, you are
Trying to get property of non-object
from the $post object.
Simply check if ( isset( $post->parent ) ) { /* do stuff */ }.
2
While I agree with Justin Tadlock on a lot of things, I strongly disagree with him on this.
The reason parent/child themes exist is that there's a lot of common functionality used across websites. Instead of re-inventing the wheel every time, it's better to build from a solid base that has been tested by hundreds of developers and used on tens of thousands ...
1
Functions.php is shared for parent/child themes unlike other files which will be overridden. What that means is that WordPress will load both the parent and the child functions.php.
In your case it sounds like you would simply create a child functions.php and then a create new register_sidebar .
Then use dynamic_sidebar whenever you want in your theme ...
1
Create a separate directory and a (sub) domain for your themes.
Lets say the domain is themes.example.com, and the directory is /extra/wp-themes/.
Now let all your installations use the new theme root. Or just do the same for plugins to manage all plugins from one place too.
Registering a new theme root is not possible with constants, you will need a ...
1
Since previous answers no longer work here in current versions of WordPress and there was a related question which I just answered (April 2013) using a PHP output buffer I figured I'd post a link to that answer.
Also just published the Omit Parent Theme Page Templates plugin that filters out all parent theme page templates from the dropdown list of ...
1
What kind of updates are you talking about?
Your understanding is basically correct: if you make a theme from a starter theme, that theme won't be automatically updated.
But depending on what kind of updates you're talking about, your themes shouldn't need to be updated every time a new version of WordPress is released. New versions of WP don't make old ...
1
On the init action, remove the action calling their function and enqueue an action calling your (differently named) function, like this:
add_action('init', 'wpse_80107_init');
function wpse_80107_init() {
// remove parent theme's header content action
remove_action('cyberchimps_header_content', 'cyberchimps_logo_icons');
// add child theme's ...
1
You can use <?php get_template_directory_uri(); ?> to reference your parent theme folders.
From the WordPress codex:
In the event a child theme is being used, the parent theme directory URI will be returned...
1
Handle all the class loading in your parent theme on a predictable action (point in time) and hook in later in your child theme.
Example:
add_action( 'wp_loaded', 'parent_prefix_load_classes', 10 );
function parent_prefix_load_classes()
{
$classes = array ( 'Extra_Comment_Walker', 'Extra_Nav_Menu_Walker );
foreach ( $classes as $class )
{
...
1
if it the functions file, the child theme is loaded in conjunction with it's parent, the child being loaded first.
If its the index.php file, you need to make sure your WordPress version greater than or equal to 3.0. Otherwise, your index.php file won't overwrite.
A lot of reworking of themes has happened in the last year, so make sure you check out ...
1
Answer remade. The original was a wild idea...
The solution is the same as the one posted by Rarst in the question linked
How to *remove* a parent theme page template from a child theme?
Difference being the admin_head hook.
And a check for only running in edit-page and not in edit-post or edit-custom_post_type, as all these cases are fired by ...
Only top voted, non community-wiki answers of a minimum length are eligible