Tag Info

Hot answers tagged

4

For a copy paste solution check this custom Walker out: http://goodandorgreat.wordpress.com/2012/01/12/update-2-using-twitter-bootstrap-dropdown-menus-with-wordpress/ It's missing one or two things like data-toggle="dropdown" and <b class="caret"></b>. It should be quite easy to figure that out, but here's my modified version: ...


4

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') ); } ...


3

Currently it is practically impossible. Need write your own version of the function. I did just so for my theme in development. There is a trac ticket requesting improvements to the function since it is inflexible, yet required for themes hosted in official repository.


2

I used a different approach than a custom walker. I used a function to add the class "dropdown" to any parent nav items which contain sub menu items. Since WordPress outputs the class "sub-menu" by default, I use jQuery to add the class "dropdown-menu" to any thing that has a class of "sub-menu". I then use jQuery to append the <b ...


2

You will need to write a custom walker extending Walker_Nav_Menu, more or less like so: class My_Custom_Nav_Walker extends Walker_Nav_Menu { function start_lvl(&$output, $depth = 0, $args = array()) { $output .= "\n<ul class=\"dropdown-menu\">\n"; } function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) { ...


1

you can try this: .navbar-fixed-top { top: 0px; } body.admin-bar .navbar-fixed-top { top: 28px !important; } if that does work for you (which it should!), then you'll have to move the wp admin bar to the bottom by sticking the code below into a plugins folder or your functions.php file: function fb_move_admin_bar() { echo ' <style ...


1

Read "Multiple Loops in Action at codex page" i think you´ll have your answer there...at least i had mine : http://codex.wordpress.org/The_Loop I did use one "featured" category. And the query was made by "Multiple loops in Action". First loop with just one post with the featured category to put the bootstrap carousel class active. Then the other loop put ...


1

I've found that for things like this, get_posts is easier. <?php // Set up your arguments array to include your post type, // order, posts per page, etc. $args = array( 'post_type' => 'testimonial', 'posts_per_page' => 3, 'orderby' => 'date', 'order' => 'DESC' ); // Get the posts ...


1

I am admittedly out on a limb here because to test this I'd have to install your code and create some menus to test it with, but... Look in the Bootstrap_Walker_Nav_Menu code. Find this: $item_output .= '<a'. $attributes .'>'; $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; ...


1

The script First you have to enqueue the script. We conditionally load it only for your custom post type and its archive(s). // in your functions.php function wpse69274_enqueue_tbs_collapse() { if ( ! is_post_type_archive() AND 'YOUR_POST_TYPE' !== get_post_type() ) return; wp_enqueue_script( 'tbs-collapse' ...


1

Check out the WordPress Bootstrap CSS plugin. It seems to contain "handy shortcodes" to insert all sorts of elements. Also check out Obenland's The Bootstrap WordPress theme that was released a week ago.



Only top voted, non community-wiki answers of a minimum length are eligible