imranhsayed / aquila

🎨 An Advanced WordPress theme
1.02k stars 217 forks source link

Fatal error: Uncaught Error: Class cannot working #101

Open liton139 opened 1 year ago

liton139 commented 1 year ago

class cannot work properly

Code is here ...

Function.php

<?php

/***

require_once MEDICALTHEME_DIR_PATH . '/inc/helpers/autoloader.php';

function Medical_enqueue_scripts() {

// Register Styles
wp_register_style('style-css', get_stylesheet_uri(), [], filemtime(get_template_directory() . '/style.css'),'all');
wp_register_style('bootstrap-css', get_template_directory_uri() . '/assets/src/library/css/bootstrap.min.css', [], false,'all');

// Register Scripts
wp_register_script('main-js', get_template_directory_uri() . '/assets/main.js',[], filemtime(get_template_directory() .'/assets/main.js'), true );
wp_register_script('bootstrap-js', get_template_directory_uri() . '/assets/src/library/js/bootstrap.min.js',['jquery'], false, true );

// enqueue style
wp_enqueue_style('style-css');
wp_enqueue_style('bootstrap-css');

// enqueue scripts
wp_enqueue_script('main-js');
wp_enqueue_script('bootstrap-js');

} add_action('wp_enqueue_scripts', 'Medical_enqueue_scripts');

?>

traits-singleton.php

<?php /**

class-medicaltheme.php

<?php /**

namespace MEDICALTHEME\Inc;

use MEDICALTHEME\Inc\Traits\Singleton;

class MEDICAL_THEME{ use Singleton;

protected function __construct(){
    wp_die('hello');
    //load class.
    $this->set_hooks();
}
protected function set_hooks(){
    //actions and filters
}

}