0
wordpress主題,我有以下爲我的functions.php連接帶引導
<?php
function portfolio_script_enqueue()
{
\t wp_register_style('bootstrap', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css');
$dependencies = array('bootstrap');
wp_enqueue_style('bootstrapstarter-style', get_stylesheet_uri(), $dependencies);
$dependenciesScript = array('jquery');
wp_enqueue_script('bootstrap', get_template_directory_uri().'/bootstrap/js/bootstrap.min.js', $dependenciesScript, '3.3.6', true);
}
add_action("wp_enqueue_scripts","portfolio_script_enqueue");
?>
和header.php中
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
\t <title>My portfolio</title>
\t <?php wp_head(); ?>
</head>
<body>
<?php body_class(); ?>
\t
要調用regiser_style,你必須在調用wp_enqueue_style –