Skip Navigation

[Resolved] image field breaking up in mobile view

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user's images are not display correctly on mobiles with the user's bootstrap grid.

Solution:
The problem is that the user is manually setting the width of the columns with css which is causing the bootstrap css to be overwritten.

What I recommend that you do is if you want a bigger column, just to user a different column size bootstrap class.
https://getbootstrap.com/docs/3.3/css/#grid

This support ticket is created 6 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 10 replies, has 2 voices.

Last updated by a.e.a.m.S 6 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#1142102
Schermafbeelding 2018-11-07 om 11.26.13.png
Schermafbeelding 2018-11-07 om 11.26.00.png

I want to show an image in a row to the right of the title field with an alignment to the right, that works but the image breaks up in mobile view. I have tried fixing it with css code but without success.

The code in the loop view:

<div class="row">
<div class="col-sm-6">[wpv-post-title][types field='training-afbeelding' title='%%TITLE%%' alt='%%ALT%%' size='custom' width='90' height='90' resize='proportional' align="right" ]</div>
<div class="col-sm-3">Bekijk deze training ></div>
</div>
<br>

#1142478

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

This is actually caused by bootstrap's responsive css.

What you might end up needing to do is this.

[php]

<img class='img-responsive' src="[types field='training-afbeelding' output='url' size='custom' width='90' height='90' resize='proportional' align="right" ]" />
[php]

The only issue is that you won't be able to output the TITLE or the ALT text as well.

Please let me know if this helps.
Thanks,
Shane

#1143645
Schermafbeelding 2018-11-09 om 09.31.23.png

Hi Shane,

If i place your line of code inside the code for the loop the image does not show, if i remove the "src=" the image shows but it does not allign to the right, see image attachment.

<div class="row">
<div class="col-sm-6">[wpv-post-title]<img class="img-responsive" [types field='training-afbeelding' output='url' size='custom' width='90' height='90' resize='proportional' align="right" ]</div>
<div class="col-sm-3">Bekijk deze training ></div>
</div>
<br>

The </div> on that specific line pops up red so i may have the code not quite right there....

#1143959

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

That is strange as the image html requires the src attribute for the link to the image.

Could you try it like this there seem to be an issue with the quotations that I had.

<img class="img-responsive"  src ="[types field='training-afbeelding' output='url' size='custom' width='90' height='90' resize='proportional' align='right' ]"<

Please let me know the results as soon as possible.

Thanks,
Shane

#1144228

That does not make a difference, image also broken up, if i remove the src =" the image is showing but alligned to the left instead of the right.

#1145139

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Could you allow me to have admin access to the site as well as a link to this page so that I can take a look ?

Thanks,
Shane

#1145177

Sorry, wrong link, the correct link: hidden link

private message

#1145254

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I believe I've found the issue.

Is there any reason why you are overwriting the bootstrap column width ?

I would like to know before I make any changes as this is the reason why you are having this issue. The bootstrap responsive css isn't being applied properly because of the custom width values.

Thanks,
Shane

#1145824

Hi Shane,

I believe i had some issues with the background color styling in the rows if i didn't put the width on 75% in the CSS editor tab.
If the background color shows fine it's not a problem for me if you make the changes.

#1145935

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I've adjusted the css and it should display fine on mobiles now.

Thanks,
Shane

#1146455

My issue is resolved now. Thank you!