Skip Navigation

[Resolved] post-type layout "blocked" image

This support ticket is created 6 years, 7 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 15 replies, has 3 voices.

Last updated by Christian Cox 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#821841

I created the layout for post types

<div class="contenitore">
<div class="layout-creatura" style="background-image:url('[wpv-post-field name='wpcf-layout-ricordo']');">
<div class="titolo-creatura">[wpv-post-title]</div>
<div class="prima-foto">[wpv-post-featured-image size="custom" height="230"]</div>
<div class="dedica">[types field='dedica'][/types]</div>
<div class="dedica-seconda">[types field='dedica-seconda'][/types]</div>
<div class="data-decesso">[types field='data-decesso'][/types]</div>
</div>
</div>

the position of the fields: title, dedication, etc. are managed with CSS code,
I wanted to understand why I can not give the background image a fixed dimension. change the values of the css code but nothing happens.

the background image that is loaded is 800x533 pixels!
this is how the image should be 800x533: hidden link

is compressed ! : hidden link

can you tell me what's wrong?

CSS code

.contenitore {
  max-width: 800px;
  width:100%;
    }


.layout-creatura {
  background-size: 100% 100%;
  background-repeat: no-repeat;
 
}

I did various tests by setting a fixed height, but nothing happens !

thank you

#823887

Well, if you set an image as a background to a DIV, it will be the background to that DIV.
That's exactly what happens here, the "layout-creatura" DIV is using the image as background.

Where do you want that image?
You need to address a parent DIV if you want it to be the background to something wider or higher.

#828882

The background inside "creature-layout" is fine as a place. I created a "container" div to put inside the layout: background, title, dedication, etc. perhaps the container div is not needed. I do not understand how to set up a main Div?

#834003

What if you set the background-size to 100% width, but leave the height attribute unset:

.layout-creatura {
  background-size: 100%;
  background-repeat: no-repeat;
}
#856853

the problem remains

#857012

Okay I think you are saying that you do not want the background image scaled at all, you want it to be displayed at exactly the same scale as the original image. So you should remove the entire background-size property:

.layout-creatura {
  background-repeat: no-repeat;
}
#857484

exactly, I want a background image.
I removed the code you wrote to me, but nothing! the problem
remains

#858063
Screen Shot 2018-05-08 at 11.35.16 AM.png

It looks like you removed the background-repeat property but left the background-size property. Sorry if my instructions were unclear. Please delete the background-size property and restore the background-repeat property.

#858228
.contenitore {
  max-width: 800px;
  width:100%;
    }


.layout-creatura {
    background-repeat: no-repeat;
}

here is the link: hidden link

that's no good

#858947
Screen Shot 2018-05-08 at 12.31.12 PM.png
Screen Shot 2018-05-08 at 12.31.22 PM.png

I don't think I understand what you expect to see. The background image is now exactly the same proportion as the original, not compressed, stretched or scaled in any way. What is the problem?

#858993

I'm sorry, in the front end the image is not good.
as you can see in the link: hidden link
it is compressed

#859198
compare-1.jpg
compare-2.jpg

I need more specific information please. When I test, there is no additional compression applied to the original image, and the proportions are identical. Please refer to these screenshots. If you disagree, please provide screenshots illustrating the problem.

#868030
Schermata del 2018-05-09 10-42-31.png

maybe I'll explain myself badly. in the frontend I can not see the background image 800x533 pixels (see screenshot - see link).
hidden link

in the back end of wordpress, media, see the perfect picture, I need it perfect even in the front end

thanks
(I hope I was clear)

#868268

This code outputs the custom field image URL:

[wpv-post-field name='wpcf-layout-ricordo']

This is the image URL from the custom field:
hidden link

If you want to use a different image here, you must change the custom field value to select the "perfect" image.

#871965

I'm sorry, I can not make you understand things.

the problem is in the layout not in the radio field, any image there is in the radio field the result is the same!

keep in mind Christian that this morning I worked on the site to make it only in English. I removed the posts and then to see other layouts go here:

hidden link