Forum Replies Created
-
AuthorPosts
-
Thanks for your support but I have managed to do this way more easily. I will post the solution here, maybe it will help someone. I have used your great filter hook
avf_header_setting_filter
.First I run this filter through the page where the header is working like I want. Trough the php function
print_r
, I have print the whole array with the header settings. Than I compare this array with the array on custom post type and missing parts added to the filter. In my case the filter looks like this.add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 50, 1); function avf_header_setting_filter_mod($header_settings) { if ( is_singular('diskuter') ) { $header_settings['header_transparency'] .= " header_transparency"; $header_settings['header_class'] .= " av_header_top av_logo_left av_main_nav_header av_menu_right av_custom av_header_sticky av_header_shrinking av_header_stretch_disabled av_mobile_menu_phone av_header_transparency av_header_searchicon av_header_unstick_top_disabled av_minimal_header av_bottom_nav_disabled av_alternate_logo_active av_header_border_disabled"; } return $header_settings; }
I don’t want the client to check the transparency setting each time when he is creating a new single post.
Isn’t possible to set it up via these filters?
avf_header_setting_filter
avf_header_classesI already make the header sticky thanks to avf_header_setting_filter. But I dont know which classes to add and remove to make it transparent and change the logo version on scroll as I have it on another pages.
Thank you.
Thank you for your reply but there is a problem. It is a custom post type and I cant see this option in the sidebar of my backend layout.
Also, I need to change the color of the logo. I guess I will need to put the classes in the header with javascript.
I thought, there is a better way to do this via php. And I still do. If it is working on page.php I don’t see a reason why it shouldn’t work on single post.
- This reply was modified 6 years, 3 months ago by Anilix.
You can check it right now.
This link is what I set up in theme options and it is how it should be on all pages of the website.
This link is on a single page where I want the same header effect.
I have used this filter:add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 50, 1); function avf_header_setting_filter_mod($header_settings) { if ( is_singular('diskuter') ) { $header_settings['header_sticky'] = 'header_sticky'; $header_settings['header_transparency'] .= " header_transparency"; } return $header_settings; }
I can see it added some classes into html tag. But I need to make the header transparent. The above filter make it only sticky and the menu text is now not visible.
When I inspect the html and comparing the site with good header and site with bad header, i can see that I’m missing some classes in the header, especialy on scroll. Is there some way to make the header the same on all pages?
Thank you.
- This reply was modified 6 years, 3 months ago by Anilix.
-
AuthorPosts