Skip Navigation

[Resolved] Add Full Width inage to 'top' of Archive Page

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

Problem:
The customer asked how to show a full-width image banner on top of the archive page, using the Divi theme.

Solution:
Suggested to add container block on top of the WordPress Archive and add an image as the background of this container.

Since, the Divi theme doesn't seem to support the WordPress' full-width alignment option, shared some custom CSS code to make it cover full-width too.

Relevant Documentation:
n/a

This support ticket is created 2 years, 9 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Adrian Robbins 2 years, 9 months ago.

Assisted by: Waqar.

Author
Posts
#2295563

We are trying to add a narrow full screen width image to the top of the Toolset WordPress Archive page, below the menu (header) and above the Page Title (Properties for Sale).

hidden link

However everything we try is not working.

Is there a way that we can do this, without having to rebuild the entire Archive page as a 'View'.

Or is there a way we can turn the Archive into a View?

#2296197
archive-image-container.png

Hi,

Thank you for contacting us and I'd be happy to assist.

To show an image at the top, you can include a "Container" block, inside the "WordPress Archive" block, as shown in the attached screenshot.

Once the container block is added, you can set it to have an image background, which will show at the top.

And to make the image container cover full-width you can set the "Block Alignment" to full-width, under the "Advanced" tab in the container block's settings.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2296373
wlb_support_screen_shot_002.jpg
wlb_support_screen_shot_001.jpg

Hi Waqar

Thank you for your very quick reply, and we can now see it is the Divi Theme, which was not showing the Full Width Option on the Advanced tab.

So, we tried the free version of the Astra theme and this also did not have the Full Width option.

We then tried GeneratePress (again free version) and whilst this does have the full width option on the advanced tab, which we have activated for the container with the background image, it is still not displaying a full width image at the top of the Archive page - it is being constrained by the template content width setting of 1200 px.

Is there a way we can get Divi to work with the Toolset Archive pages?

So, our original plan had been to use the Divi Theme Builder, and build a Custom Archive page. However when we do this, for some inexplicable reason we lose ALL the Toolset Archive content and just end up with the Divi modules we have added to the custom Archive page and NO Toolset Archive content.

Any idea on why it is being blocked and if there is a way to overcome?

We use Divi on a lot of client projects, and our clients find the Divi Visual Page builder is very easy to work with, when editing general page content, so we would ideally like to get Toolset Archives working with the Divi Theme Builder.

Hopefully you can shed some ligth on this.

Kind regards
Ade

#2298367

Thanks for writing back.

The challenge here is that the Divi theme doesn't seem to support the WordPress' full-width alignment option.
( you can consult its official support team to see if there is an official approach to enable it )

As a workaround, you can include the following CSS code in the WordPress Archive's custom CSS:
( screenshot: hidden link )


.tb-container.alignfull {
width: calc(100vw - 8px);
position: relative;
left: 50%;
right: 50%;
margin-left: -50vw;
margin-right: -50vw;
}

#2298857

Hi Waqur

Thanks for the CSS code, which has made the container full screen - impressive CSS.

Now we have it full screem which is brilliant, I have two more questions 🙂

1) Is there a way to 'resize' the image for a mobile? I have been experimenting with a media query, but it 'broke' your css code.

2) Can we offset the heading to the left of the page container (currently set at 1200 px).

Kind regards
Ade

#2299749

Thanks, for the update, and glad that the CSS code worked.

1. To make the background image proportionally resize on smaller screens, you can use the device icons in the container block's settings and set the background to 'contain' property.
( screenshot: hidden link )

To control this through custom CSS media query, the code will look like this:


@media only screen and (max-width: 800px) {
.tb-container.alignfull {
    background-size: contain !important;
}
}

2. In the custom CSS code ( file: {yourwebsite.com}/wp-content/et-cache/global/et-divi-customizer-global.min.css ), I see this code:


.archive-master-heading {
    color: #fff;
    font-size: 50px;
    font-weight: 600;
    padding-top: 200px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

The left and right 'auto' margin is making the heading text appear center-aligned. You can remove that and the heading text will become left-aligned.

#2299903

Hi Waqar

Thank you for supplying the code and I think that is everything now sorted.

Very much appreciate your help.

Kind regards
Ade

#2299905

My issue is resolved now. Thank you!