Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Recently I made a simple web template using basic HTML and twitter bootstrap along with my own custom CSS. I want to convert that into a WordPress theme.

I know how to create WP theme from basic template . But how can I integrate twitter bootstrap with it?

If I put bootstrap.css, bootstrap-responsive.css, custom.css (my custom CSS file) into the CSS folder of WordPress theme, and bootstrap.min.js into my js folder of wp theme , will it work?

share|improve this question
Have you tried it? – toscho Jan 25 at 14:26
not yet , I want to be sure before move on – Shuvro Shuvro Jan 25 at 14:31
1  
Why would it not work? – Chip Bennett Jan 25 at 14:36
2  
You learn by trying, always try and then ask, saves you so much time and you get a nice feeling of accomplishment from it too – Tom J Nowell Jan 25 at 15:15
thanks , next time I will follow your suggestion – Shuvro Shuvro Jan 25 at 16:54
show 1 more comment

1 Answer

Almost.

Put the bootstrap stuff in your theme, and include it on the front end using wp_enqueue_style and wp_enqueue_script in functions.php

e.g. for the bootstrap js:

function my_scripts_method() {
    wp_enqueue_script(
        'bootstrap-js',
        get_template_directory_uri() . '/js/bootstrap.min.js',
        array('jquery')
    );
}
add_action('wp_enqueue_scripts', 'my_scripts_method');

And for bootstrap.css:

add_action( 'wp_enqueue_scripts', 'prefix_add_my_stylesheet' );
function prefix_add_my_stylesheet() {
    // Respects SSL, Style.css is relative to the current file
    wp_register_style( 'bootstrap-css', get_template_directory_uri() . '/bootstrap.css';
    wp_enqueue_style( 'bootstrap-css' );
}
share|improve this answer
Thanks , I am trying this now – Shuvro Shuvro Jan 25 at 14:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.