Articles of parent theme

Localization: Textdomain of Child teme

I am creating a series of WP child themes which are dependent of a parent theme which I will be using as a framework. I need to have these themes (both parent and children) localized. from I understood I need to add the following to my theme: add_action(‘after_setup_theme’, ‘my_theme_setup’); function my_theme_setup(){ load_theme_textdomain(‘mytextdomain’, get_template_directory() . […]

Updating parent themes vs. updating starter theme

Context: I use framework parent themes (e.g. Thematic) mainly because it ensures that my custom themes inherit cutting-edge and standard compliant code. Why I’m not yet using starter themes: I’m reluctant to use starter themes (e.g. _s, Bones etc.) because, as I understand it, I’ll need to screen for code changes with every version update […]

Passing variable from child theme to parent theme

I want to pass my google map custom colors from my child theme to my parent theme. So in my Parent Theme’s functions.php I have add_filter( ‘post_thumbnail_html’, “map_thumbnail” ); function map_thumbnail($html, $color1, $color2) { $my_post = get_post($post->ID); $water_color=$color1; $tree_color=$color2; if($my_post->post_name == “contact”) { $html = ‘<img height=”100%” width=”100%” src=”’.$water_color.’treecolor=’.$tree_color.'”>’; } return $html; } I just […]

Child themes: disabling the parent

I’m creating a parent theme and several child themes. But how can I prevent the parent theme from ever being used?

How to use parent theme's enqueue methods

According to the codex, when creating a child theme, you have to manually enqueue the parent theme‘s scripts. My parent theme has logic to conditionally display various css files, cached css, and dynamic css generated from a Theme Options dashboard. The theme is called Camille. function camille_scripts() { wp_register_style(‘bootstrap’, get_template_directory_uri() . ‘/css/bootstrap.css’); wp_enqueue_style( ‘bootstrap’ ); […]

How can I remove css from a child theme?

I am using the theme twentyten as a parent theme for my child theme. I have other stylesheets I want to use and so I’m trying to figure out how to wp_deregister_style for the style.css sheet that is printed out in the head section of the html. I have checked the global $wp_styles variable around […]

PHP Notices appear when browsing any page in admin, but only for child theme, using code from WP Codex

My php_error.log in my console (locally on OSX) is reporting 3 PHP Notices. The PHP Notices only appear when browsing each admin page in the back-end for a site (running multisite) that uses a child theme. The child theme uses the parent theme‘s sidebar.php which the code below is placed in. The PHP notices do […]

Is it possible to override this function/class in a child theme?

Is it possible to override this widget function from a parent theme? I saw this blog, but it dealt with a simpler case. parent class Chocolat_Widget_New_Entrys extends WP_Widget { function __construct() {… function widget( $args, $instance ) {… } add_action( ‘widgets_init’, create_function( ”, ‘return register_widget( “Chocolat_Widget_New_Entrys” );’ ) ); I attempted to use remove_action(‘widgets_init’,’???’); […]

Should I ask a theme developer to use locate_template rather than require_once

I was creating a child theme today and needed to overwrite a php file which was included using this code in the themes functions.php file require_once( get_template_directory() . ‘/function-includes/theme-functions.php’ ); I tried using require_once( get_stylesheet_directory(). ‘/function-includes/theme-functions.php’ ); in my child themes functions file but it caused an error and didn’t load the site at all. […]

How to check active theme is parent or child wordpress

I am working on a plugin in plugin. I make template folder and in template folder and there are files of plugin that shows my post type data. First Scenario When user activate my plugin the template folder move to active theme folder. Its working perfectly. Second Scenario Now If there is parent and child […]