- This topic has 18 replies, 3 voices, and was last updated 4 years, 5 months ago by Tom.
-
AuthorPosts
-
September 27, 2017 at 8:44 pm #393286themedleb
Hello,
I want to make the page header’s background image with blur effect, I tried to paste the following code in many related classes:
-webkit-filter: blur(5px);
-moz-filter: blur(5px);
-o-filter: blur(5px);
-ms-filter: blur(5px);
filter: blur(5px);But it always affect everything including the page header’s content (post-title, post-date, post-author, …), can you please tell me what is the class (or whatever) I should use the code with?
September 28, 2017 at 12:05 am #393320TomLead DeveloperLead DeveloperSeptember 28, 2017 at 12:19 am #393332themedlebYeah, it’s from there I took the code I showed you before, and tried to paste it in many classes (each time = one class) and set the z-index for each as specified in the link you gave me, but always resulted to blur everything in the page header, including the page header’s content, but I just need to know what is the specific class (or whatever) is responsible of showing the featured image in the page header so I can apply the blur effect and z-index in it.
September 28, 2017 at 11:17 am #393698TomLead DeveloperLead DeveloperI think that’s the thing, it can’t be done with the current implementation.
You need to remove the current background image, then apply this method using the
.page-header-content
class: https://stackoverflow.com/a/33091315/2391422September 28, 2017 at 9:18 pm #393973themedlebThank you, If I remove the background image, I think there will be nothing to apply the blur effect on, so no need for that effect.
Regards.
September 28, 2017 at 10:02 pm #393990TomLead DeveloperLead DeveloperThe image would need to be applied to an element inside the content area:
<div class="image-container"></div> Content here
So the image would be applied to that image-container element using the method in that thread.
September 28, 2017 at 10:40 pm #394000themedlebOkay, so what should I do as steps? I’m confused now, and so hyped to make this work as well, please just give me codes and show me where to put them, I’m so thankful for that.
September 29, 2017 at 9:50 pm #394562TomLead DeveloperLead DeveloperLooking at it more, those solutions require you to use fixed or absolute positioning, which is pretty hacky.
Why not just apply the blur to image itself in an image editing program?
September 29, 2017 at 11:40 pm #394598themedlebI thought about it before, but the image will look blurry everywhere in the website, I just need this effect only in singular posts, where the image is under text/infos (post-title, post-author, post-date …), so these infos will look clear on the top of the image.
If I need to replace some CSS (or PHP) in the theme files to get it work, I already have no problem with that, but if it is tiring and time consuming, we can just avoid it and move on.
If you have time and can help me, I would appreciate it so much.
Thank you.
September 30, 2017 at 10:06 pm #395092TomLead DeveloperLead DeveloperWhy not just use that one image on that single page? No need to use it everywhere.
You can also use the background color overlay option to make text more readable.
September 30, 2017 at 10:52 pm #395107themedlebBecause the image I am talking about is the featured image, every post will have a different one, if I made one of them blurry (using Photoshop) every other featured image should be the same following the same norm/standard, which will result a page full of blurry images (the page where all posts should appear, in columns/masonry like search results page), that’s why the only option I have is to apply blur effect only on featured images of singular posts, so no image will be affected when all posts appear in columns/masonry like the search results page.
I know about the background color overlay option, but I want my website to be a little bit unique and fancy, just so you have an idea of what the header page content looks like with blur effect and without, here is an example:
With blur
With background color overlayRegards.
October 1, 2017 at 10:58 pm #395671TomLead DeveloperLead DeveloperYou could try this..
Remove the image from your Page Header.
Then add this CSS to the page:
.page-header-content { overflow: auto; position: relative; } .page-header-content:before { content: ""; position: fixed; left: 0; right: 0; z-index: -1; display: block; background-image: url('URL TO IMG HERE'); background-size:cover; width: 100%; height: 100%; -webkit-filter: blur(5px); -moz-filter: blur(5px); -o-filter: blur(5px); -ms-filter: blur(5px); filter: blur(5px); }
October 2, 2017 at 2:39 am #395725themedlebOkay, but according to this code of CSS, I will manually set the same background image for all posts, right? (please correct me if I’m wrong). But what’s supposed to be is: each and every post should have its own featured image.
October 2, 2017 at 9:12 am #395935TomLead DeveloperLead DeveloperThat’s correct. The set up you’re wanting isn’t possible using the regular options – you need to use CSS.
October 2, 2017 at 9:20 am #395946themedlebI tried all the CSS codes your gave me. Anyway, I think this is not achievable at the moment as long as the background featured image of the Page Headers is merged with Page Headers content. Thank you Tom for your precious time, I hope I have the ability to make Page Headers with blur effect in the future.
Thanks.
-
AuthorPosts
- You must be logged in to reply to this topic.