badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

ed1996

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Loading header-extension.php in Child Theme #27692
    ed1996
    Participant

    Hi Mark,

    I’ve managed to get my child header-extensions.php to work. I’m an extremely novice programmer, so there probably is a better solution out there. However, I’ll post the code that I’m using and provide an explanation.

    <?php
    
    function unhook_thematic_functions(){
    	remove_action('interface_init', 'interface_constants', 10);
    }
    
    add_action('init', 'unhook_thematic_functions');
    
    add_action( 'interface_init', 'interface_child_constants', 10 );
     
    function interface_child_constants() {
    	
    	/** Define Directory Location Constants */
    	define( 'INTERFACE_PARENT_DIR', get_template_directory() );
    	define( 'INTERFACE_CHILD_DIR', get_stylesheet_directory() );
    	define( 'INTERFACE_IMAGES_DIR', INTERFACE_PARENT_DIR . '/images' );
    	define( 'INTERFACE_INC_DIR', INTERFACE_CHILD_DIR. '/inc' );
    	define( 'INTERFACE_PARENT_CSS_DIR', INTERFACE_PARENT_DIR. '/css' );
    	define( 'INTERFACE_ADMIN_DIR', INTERFACE_INC_DIR . '/admin' );
    	define( 'INTERFACE_ADMIN_IMAGES_DIR', INTERFACE_ADMIN_DIR . '/images' );
    	define( 'INTERFACE_ADMIN_JS_DIR', INTERFACE_ADMIN_DIR . '/js' );
    	define( 'INTERFACE_ADMIN_CSS_DIR', INTERFACE_ADMIN_DIR . '/css' );
    	define( 'INTERFACE_JS_DIR', INTERFACE_PARENT_DIR . '/js' );
    	define( 'INTERFACE_CSS_DIR', INTERFACE_PARENT_DIR . '/css' );	
    	define( 'INTERFACE_FUNCTIONS_DIR', INTERFACE_INC_DIR . '/functions' );
    	define( 'INTERFACE_SHORTCODES_DIR', INTERFACE_INC_DIR . '/footer_info' );
    	define( 'INTERFACE_STRUCTURE_DIR', INTERFACE_INC_DIR . '/structure' );
    	if ( ! defined( 'INTERFACE_LANGUAGES_DIR' ) ) /** So we can define with a child theme */
    		define( 'INTERFACE_LANGUAGES_DIR', INTERFACE_PARENT_DIR . '/languages' );
    	define( 'INTERFACE_WIDGETS_DIR', INTERFACE_INC_DIR . '/widgets' );
    
    	/** Define URL Location Constants */
    	define( 'INTERFACE_PARENT_URL', get_template_directory_uri() );
    	define( 'INTERFACE_CHILD_URL', get_stylesheet_directory_uri() );
    	define( 'INTERFACE_IMAGES_URL', INTERFACE_PARENT_URL . '/images' );
    	define( 'INTERFACE_INC_URL', INTERFACE_PARENT_URL . '/inc' );
    	define( 'INTERFACE_ADMIN_URL', INTERFACE_INC_URL . '/admin' );
    	define( 'INTERFACE_ADMIN_IMAGES_URL', INTERFACE_ADMIN_URL . '/images' );
    	define( 'INTERFACE_ADMIN_JS_URL', INTERFACE_ADMIN_URL . '/js' );
    	define( 'INTERFACE_ADMIN_CSS_URL', INTERFACE_ADMIN_URL . '/css' );
    	define( 'INTERFACE_JS_URL', INTERFACE_PARENT_URL . '/js' );
    	define( 'INTERFACE_CSS_URL', INTERFACE_PARENT_URL . '/css' );
    	define( 'INTERFACE_FUNCTIONS_URL', INTERFACE_INC_URL . '/functions' );
    	define( 'INTERFACE_SHORTCODES_URL', INTERFACE_INC_URL . '/footer_info' );
    	define( 'INTERFACE_STRUCTURE_URL', INTERFACE_INC_URL . '/structure' );
    	if ( ! defined( 'INTERFACE_LANGUAGES_URL' ) ) /** So we can predefine to child theme */
    		define( 'INTERFACE_LANGUAGES_URL', INTERFACE_PARENT_URL . '/languages' );
    	define( 'INTERFACE_WIDGETS_URL', INTERFACE_INC_URL . '/widgets' );
    
    }
    ?>

    My previous child functions.php unhooked the wrong function. In this new functions.php I’ve changed the location where the header-extensions.php filed is sourced to my child-theme directory from the parent directory.

    As well as using this code, I had to create the inc directory in my child theme. I also copied the folders in the parent inc directory (admin, footer_info, functions, structures, widgets) to the child inc directory. Lastly I just replaced the original header-extensions.php with the custom one.

    Let me know if you have any questions,
    Edward

    in reply to: Can't view theme options #26767
    ed1996
    Participant

    Thank you very much for your help, that did the trick.

    in reply to: Can't view theme options #26763
    ed1996
    Participant

    Hi, thank you for the fast reply. I will try that now.

Viewing 3 posts - 1 through 3 (of 3 total)