Slider Revolution Above Masthead Ethos Posts Page

hi

It is well documented that you cannot have a slider above the masthead on a posts page in Ethos without editing the functions.php file. I don’t know why it was built that way, but it is what it is.

I found a thread which describes fully how to do it and have edited the functions.php file with the following

add_action( 'x_after_view_global__slider-above', 'x_print_top_slider' );
function x_print_top_slider(){
  if( is_singular('post') || is_category() ){
    echo do_shortcode( '[rev_slider alias="Content_Page"]' );
  }
}

I didn’t originally have a slider with the alias Content-Page, so changed an existing one to that alias to be able to test. This is the message which appears when I open that post page up.

Here is a copy of the shortcode so you can see the alias is correct

[rev_slider alias="Content-Page"][/rev_slider]

Two questions; why is the posts page not detecting the slider and why does the background image appear in the sidebar as well and not just above the masthead?

The aim of all of this is just to be able to put a background image above the masthead in posts pages and have it full width and height. I am not married to the idea of doing it in a slider unless that is the only way. I want a different image for each post page, so will there need to be a new entry in functions.php for each and every page I want to do this on? Seems a cumbersome way to add an image above the masthead.

If you need the posts page in question let me know and I can supply login details. I do hope this is possible, as I’d like to have some consistency with the site and a hero image on every page appeals to me.

Regards

Hi @guybower1,

From your php code added on functions.php file, your alias is Content_Page while on your revlider shortcode it is Content-Page. See the difference? Underscore versus dash. That’s the reason it is not found. Please use the correct alias on the php code.

Please share the specific URL with this issue and explain your expected result so we can see how it happened.

Yes, this is possible using slider but you are correct that it will be to much to maintain. This feature is unfortunately not available for post pages. It would be best if you can consult a web developer. The best way for this is to add a section with background image. Then on post pages, you may add another custom image field, then on the code, you will just retrieve this custom image field and then add it on the section background. Then this section can be added either via functions.php or directly on post page template. Unfortunately this customization is outside the scope of our support. Thank you for understanding.

hi Lely

Thanks so much for your reply.

Well spotted on that; my bad hey? A dash instead of an underscore…doh!

Ok, so have amended that and now the image is covering the entire page, above and below the masthead and in the sidebar.

URL is in a secure note

Incidentally, the original line in the functions.php was changed to x_before_masthead_begin I think originally it was something like x_after_view_global__slider-above. This change was suggested by Jade a day or 2 ago. This actually made no difference, as the image still appears both above and below the masthead and in the sidebar

Thanks for spotting that basic typo

regards

Lely

Forgot to ask, you mention to add a section with a background image. Can that section be made to appear above the masthead?

Are all stacks this way, or is it only Ethos? I’d dearly love to have a different image above the masthead on all posts pages, so if Ethos cannot do it, can one of the other stacks?

cheers

Hi @guybower1,

I can see you have added the background on this settings:


That feature is setup to be a page background. That’s why it will show on the entire page. That is not meant to show above masthead only.

Yes, this feature is not available on all stacks.

For the section I have discuss above, yes it possible to be added on the location of above masthead. I discuss this as your possible solution. The thing is with customization, anything you add is possible as long as you know how to manipulate the template and the structure. I have discuss it as a guide only. Implementation is still outside the scope of our support. Thank you for understanding.

hi Lely

Thanks so much for your reply

I had one of your colleagues say exactly the same thing re the way that image was placed, but frankly it is simply not the case. I installed a template from you Design Cloud area. The template is Ethos Business. The homepage of that template has the image placed exactly that way and the slider is merely to drop some text onto the image. That image works perfectly above the masthead and was the reason why I placed the image on the posts page that way. I am happy to change how the image is placed, if there is a way for it to sit above the masthead and not in the sidebar. That was the reason for my post, as if you can do it on the homepage, then why not on a posts page? Are you of a mind that if I add the image to the slider, then it will ONLY be above the masthead and not also in the sidebar, or do you believe it is not possible at all in Ethos?

I have already made an amendment to the functions.php file to at least get the image above the masthead, as you have seen, but I do need it to be wholly above the masthead and not spill into the sidebar. I am not married to the idea of remaining in the Ethos stack to facilitate this, so if the php file cannot be tweaked to do what I need, then I am wondering which of the stacks will allow an image above the masthead, either in a slider or not

cheers Lely

Hi @guybower1,

My apologies but we seem to be going in circles here. You aim to place a full-size image on top on top of posts and we already made it clear in the previous thread that there is no out of the box option available for that. If you want to do it, you will have to add it as a slider and make sure of a hook to place the slider on top of the header area.

We’ve been repeatedly explaining that what you are trying to do is setting a background image which I believe was clearly explained that it will be behind the content area because - that is set as a background image and not a top header/hero image.

What you did was create a slider with a transparent background with a text in it and still added the image as the post’s background image so of course, the image will remain the background image of the entire page including the slider. If you want the image to be restricted to the slider area, please set the image as the slide’s background image - not the page background image.

https://www.themepunch.com/slider-revolution/slide-background/#image

As for the Ethos Business homepage, the image on top of is a slider. That is made possible because the homepage is a page and not a post, it has the slider settings option. No stack has the slider setting option on posts. It’s exclusive for pages.

As Lely mentioned, since what you are trying to do does not have an out of the box option, we can only provide some guides and suggestions on what you are trying to achieve.

Hope this explains it.

hi Jade

Thanks so much for your reply.

Bring on the new layout builder

cheers

1 Like

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.