If image width bigger than height [duplicate]

Use wp_get_attachment_metadata(). Using your example: $img_data = wp_get_attachment_metadata( $attachment_id ); $w = $img_data[‘width’]; $h = $img_data[‘height’]; if ($w > $h) { $class = “col-sm-12”; } else { $class = “col-sm-6”; } Though, to get the attachment ID, you’ll either have to put a filter that acts on every image or create a loop that uses … Read more

How to make this splash page responsive

as I understood you have two parts header, one for register one for logo, in bootstrap 3 : <div class=”row”> <div class=”col-md-6 col-xs-12″>logo here</div> <div class=”col-md-6 col-xs-12″>Register here here</div> </div> It will make your header responsive. and if you want that your image be responsive you can do like this in bootstrap 3: <img src=”https://wordpress.stackexchange.com/questions/210782/…” … Read more

Bootstrap navbar-fixed-top issues [closed]

In admin-bar.min.css at 600px, #wpadminbar is changed from position:fixed to position:absolute. The reason the adminbar scrolls at mobile sizes is because a fixed-height, fixed-position element causes major problems when you tap/pinch-to-zoom in mobile browsers. So, you can fix this by overriding WP’s native css on #wpadminbar, but then the behaviour is deliberate.

WordPress Loop with Custom Post Type for Bootstrap Accordion [closed]

You put the accordion inside the loop, that’s why it is not working as you want. Try this: <?php $args = array( ‘post_type’ => ‘review’ ); $the_query = new WP_Query($args); ?> <div class=”row mb-5″> <div class=”col-md-9″> <div id=”accordion” role=”tablist” aria-multiselectable=”true”> <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : ?> <?php $the_query->the_post(); ?> … Read more

Use bootstrap for wordpress gallery? [closed]

The gallery shortcode is contained in the wp-includes/media.php file. There is a function gallery_shortcode( that does all work. About 25 lines down you find: $output = apply_filters( ‘post_gallery’, ”, $attr, $instance ); if ( $output != ” ) { return $output; } This code goes out and runs any filters tethered to post_gallery, and if … Read more

Parent style messing up with Bootstrap [closed]

input[type=”text”] is more specific than class selector .form-control so the bootstrap.min.css is not overwriting the css in style.css although the bootstrap.min is loaded after style.css. You have to add css with more or same specificity to overwrite. For selector input[type=”text”] you can add the properties of .form-control class in style.css