Connected bootstrap through header.php.

On the main page everything works fine.

Created another page, neither the bootstrap nor the connected fonts work there.

The question is: because of what this can happen and how to solve?

  • And if you look at the source of the page in the browser, there are visible connected css? - Dmitry Kozlov
  • Did you connect under another CSS page? - Insider
  • @DmitryKozlov yes, css plugins and css installed themes are connected - rival.dm
  • @insider But isn't the same header.php and footer.php used to build the page? After all, at least the footer on the new page is the same as on the main page. Or do I misunderstand? - rival.dm
  • Show link? It seems that you have several header.php in the topic. And the styles should not be connected through the wp_enqueue_style , but through wp_enqueue_style - mihdan

1 answer 1

In Wordpress, all styles and scripts should be connected via functions.php. To connect the bootstrap correctly, it is enough to upload bootstrap.css and bootstrap.js via ftp to the appropriate folders, and add the following lines to functions.php:

 wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array( ), false, 'all' ); wp_enqueue_script('jquery'); wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.js', array( ), false, 'all' );