Tag Info

New answers tagged

0

Retrieve caption of image correct format is <?php $post_thumbnail_id = get_post_thumbnail_id( $post_id ); ?> <?php function wp_get_attachment( $attachment_id ) { $attachment = get_post( $attachment_id ); return array( 'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ), 'caption' => ...


0

Thanks for your answer Eric Holmes. The second step didnt work for me at first. I had to tweak it like this $('#menu-main a').each(function(){ $(this).removeAttr('data-toggle'); }); It is not #main-menu but #menu-main The attribute to remove is not data-target but data-toggle


0

For the hover, you shouldn't need JS. All you have to do is specify :hover on the 'li' item before the 'a' in css, instead of a:hover. .navbar-default .navbar-nav>li:hover>a Here's some CSS for regular and hover states: .navbar-default .navbar-nav>li> a{ color: black; background-color: white; } .navbar-default ...


1

The best way to include bootstrap in your theme is to enqueue bootstrap css and js in your functions.php file. This is how you can enqueue bootstrap css and js from CDN hosted version. function my_scripts_enqueue() { wp_register_script( 'bootstrap-js', '://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js', array('jquery'), NULL, true ); ...


0

I think your code generates broken HTML, so Bootstraps carousel cant work properly. Try this: <?php $q = new WP_Query(array( 'post_type' => 'post', 'posts_per_page' =>'8', // here you advice WP to just take 8 Posts, not more, the others will be paged, if you would like to use all ...


2

You can use wp_deregister_style in your child theme. Like this. function remove_unwanted_css() { wp_dequeue_style( 'bootstrap' ); wp_deregister_style( 'bootstrap' ); wp_dequeue_style( 'bootstrap-custom' ); wp_deregister_style( 'bootstrap-custom' ); } add_action( 'wp_enqueue_scripts', 'remove_unwanted_css', 20 ); Similarly you can ...



Top 50 recent answers are included