Take the 2-minute tour ×
WordPress Development Stack Exchange 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 '13 at 14:26
    
not yet , I want to be sure before move on –  Shuvro Shuvro Jan 25 '13 at 14:31
1  
Why would it not work? –  Chip Bennett Jan 25 '13 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 '13 at 15:15
    
thanks , next time I will follow your suggestion –  Shuvro Shuvro Jan 25 '13 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 '13 at 14:38
    
Hey Tom, I'm just curious if you've worked with starter themes such as hybrid core, toolbox & _S ( maintained by Automattic Theme team ) and bootstrap together? What's your recommendation as to how to tie these starter themes with bootstrap? If you like, you can answer this question of mine at wordpress.stackexchange.com/questions/108970/… thx. –  Average Joe Aug 5 '13 at 14:43
    
I'm sorry but that makes little sense, perhaps you mean you want to integrate the two? The question you linked to is huge and unclear/vague –  Tom J Nowell Aug 5 '13 at 16:02
add comment

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.