ewels / CPT-Bootstrap-Carousel

WordPress plugin which generates a custom post type for choosing images and content. Outputs Bootstrap Image Carousel (slider) HTML from a shortcode.
http://wordpress.org/plugins/cpt-bootstrap-carousel/
GNU General Public License v2.0
51 stars 36 forks source link

Update cptbc-frontend.php for using background-images to not set the … #81

Closed mapled closed 8 years ago

mapled commented 8 years ago

…size of the div to zero.

When using the CSS background images option the height option is used to set the height of the carousel images. Besides there are cases where you want to set the height to a particular value, 0 does not make sense at all. In this case every carousel item is set to "height:0px" and you do not see anything. The code change suggests an if statement which checks the value of the option 'Height if using bkgrnd images (px)' ($atts['background_images_height']) for not beeing 0. If it is zero, there is no ouput, otherwise it will echo the saved value.

ewels commented 8 years ago

Hi @mapled,

Thanks for this! Is there a common scenario when the value would be set to 0? What happens to the carousel if no height style is printed, does it still work?

Cheers,

Phil

mapled commented 8 years ago

Hi Phil,

Is there a common scenario when the value would be set to 0?

I can't think of one. I think a hint at the option like "If '0' no height will be set."

What happens to the carousel if no height style is printed, does it still work?

I am working with version 1.9.1. If I put no height in the options, the plugin sets itself to '0'.

I have to test it with 1.9.2.

Cheers, Philipp

ewels commented 8 years ago

ok, so the second thing (saving no height in the options saves as 0) is a common scenario ;) What I meant is, with your new code (and no height set), what happens to the carousel? Do the images show?

Phil

mapled commented 8 years ago

Do the images show?

Jup, they show up :), covering the whole viewport, centered and nicely scaled ... The Website is not live yet, which is why I unfortunately can't give you a demo.

Cheers Philipp

ewels commented 8 years ago

ok, great! Thanks!