Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Replace header template from plugin

function header_override () {
    // $template = locate_template('header.php');

    // load_template(plugin_dir_path( __FILE__ ) . 'templates/header.php');
    // print_r($template);

    if ( $overridden_template = locate_template( 'header.php' ) ) {
        load_template( $overridden_template );
    }else{
        load_template(plugin_dir_path( __FILE__ ) . 'templates/header.php');
    }
}
add_action('template_include', 'header_override');


function new_header_output() {
    remove_action( 'get_header', 'header_output', 20);
    load_template(plugin_dir_path( __FILE__ ) . 'templates/header.php');
}
add_action('get_header', 'new_header_output');


function action_function_name_391( $name, $args ){
    print_r("custom header");
}
add_action( 'get_header', 'action_function_name_391', 10, 2 );
Comment

PREVIOUS NEXT
Code Example
Php :: php remove value from array if exists 
Php :: download yii 1.1 
Php :: Dorf SMS Plugin 
Php :: Laravel eger loading relationship with selected column 
Php :: symmetric decryption in php 
Php :: WooCommerce Catalog Mode snippets 
Php :: easyadminbundle 4 $this-get(EntityRepository::class) error 
Php :: Program to Multiply Two Numbers in php 
Php :: Verifying a login cookie 
Php :: what is WP_USE_THEMES 
Php :: how to compare two strings ignoring accentuation in php 
Php :: multiple slug in route 
Php :: data validation of $_POST in php 
Php :: wp ajax error handling 
Php :: PHP OOP - Class Constants 
Php :: php Sum of all the factors of a number 
Php :: themeHeader 
Php :: php document append script to head 
Php :: nano seed generator 
Php :: php array_intersect_assoc 
Php :: codeigniter query Profiling - To enable the profiler 
Php :: in packagemanifest.php line 131 undefined index name 
Php :: laravel short collection by keys based on array 
Php :: laravel model where set fields laravel 
Php :: wordpress not logging when using ngrok 
Php :: run drush command from php 
Php :: Multiple Formats with PHP DateTime::createFromFormat() 
Php :: remove index.php 
Php :: ? in php 
Php :: artisan command to add resources to controller 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =