Fabian Rivera Restrepo
Preguntastudent•
hace 4 años
Me presenta este problema en la consola
y no me deja ver el header y mi código está así:
index.php
<?php wp_head(); ?> <?php wp_footer(); ?>
functions.php
<?php function init_template() { add_theme_support( 'post-thumbnails' ); add_theme_support( 'title-tag' ); } add_action( 'after_setup_theme', 'init_template' ); function assets() { wp_register_style( 'bootstrap', 'https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css', '', '5.0.2', 'all' ); wp_register_style( 'montserrat','https://fonts.googleapis.com/css2?family=Montserrat&display=swap','','1.0','all' ); wp_enqueue_style( 'estilos',get_stylesheet_uri(), array( 'bootstrap','montserrat' ), '1.0', 'all' ); wp_enqueue_script('bootstrap','https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js','', '5.0.2',true); wp_enqueue_script( 'custom',get_template_directory_uri().'/assets/js/custom.js','','1.0',true ); } add_action( 'wp_enqueue_scripts', 'assets' );
header.php
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <?php wp_head() ?> </head> <body> <header> <div class="container"> <div class="row"> <div class="col-4"> <img src="<?php echo get_template_directory_uri()?>/assets/img/screenshot.png" alt="logo"> </div> </div> </div> </header>
0
Carlos Daniel
student•
hace 4 años
Creo que tu error se encuentra en index.php en vez de wp_head(); intenta con:
<?php get_header(); ?> <?php get_footer(); ?>
0
