Forum Replies Created
-
AuthorPosts
-
Hi! In my testing I deactivated the code and as I already mentioned the path versions are loaded correctly if the code is inactive. White an all screen sizes.
With the active code in functions.php there is only the white one on large screens (the one defined for transpareny mode) and the blue one (normal logo) on screen sizes below 990px. Activated the code and you can see the behaviour online.
Maybe you can check CSS because what’s interesting: I don’t have the lines mentioned from Guenni007 in my layout.css. See our posts above.
Thanks in advance!
Kind regards,
DanielThank you for giving it a try. Very interesting. In my installations there is the following CSS:
@media only screen and (max-width: 989px) { .responsive.html_mobile_menu_tablet #top .av_header_transparency.av_alternate_logo_active .logo a > img, .responsive.html_mobile_menu_tablet #top .av_header_transparency.av_alternate_logo_active .logo a > svg { opacity: 1; } } @media only screen and (max-width: 989px) { .responsive.html_mobile_menu_tablet #top .av_header_transparency .logo img.alternate, .responsive.html_mobile_menu_tablet #top .av_header_transparency .logo .subtext.avia-svg-logo-sub { display: none; } }
Don’t know where it comes from. The first shows the normal logo, the second hides the alternate version below 990px. That’s exactly the error.
In your installation it is like that:
#top .av_header_transparency.av_alternate_logo_active .logo a > img, #top .av_header_transparency.av_alternate_logo_active .logo a > svg { opacity: 0; } .av_header_transparency .logo img.alternate, .av_header_transparency .logo .subtext.avia-svg-logo-sub svg { opacity: 1; }
No query whatsoever. But the CSS above is not from me. It has to be from Enfold.
Your test is: Logo in backend, alternate logo in backend, code from above in functions, page set to “transparent header” – correct?
I built that code with Ismael in an other thread. Works on multiple installations for me. All with Enfold 7.1.1. In the theme settings I put the logos as SVG files and those files are loaded in the frontend. As it used to be in older Enfold versions.
Now I double checked the avia-snippet-sticky-header.js and see it just as you described: only styling of the header, no tweaking of the logo
On an other installation I tried the code and it is working as expected, but same behaviour on mobile: the normal logo is loaded, not the one defined in the transparency settings.
I believe it is because usually the header isn’t transparent on mobile. Even with header set to transparent in backend it is only transparent for the larger screen sizes. On mobile the header is normal and therefore the normal logo is loaded and used instead of the one from the transparency settings.
My conclusion is that I will have to sort it out with CSS since both logos are available in the code.
But what’s interesting: If I use the SVGs as path (without the code mentioned above) the version from the transparency settings is used on mobile too. That’s different to older Enfold versions and to the behaviour with a logo as image file. Or am I wrong?
I basically agree with you. But that means having the appropriate files, editing them if necessary and in addition writing CSS rules for the display in the transparent header. That’s a lot of work (if you’re responsible for a lot of homepages) and that is why I like to continue working with SVGs as linked files. This also makes exchange of a logo easier. In my opinion.
Unfortunately my question has still not been answered: Is it defined somewhere in avia-sticky-header.js which logo file is loaded for the transparent header? Is there a difference with regard to mobile screens? If so, I would have to take another look at the file and make the necessary adjustments.
In avia-sticky-header.js?
That is correct. But sometimes SVGs are quite complex in structure and for those cases I use the code above to load them as a file rather than the path. I can sort it out with CSS, no problem. But I dont’t understand the behaviour right now. Is anything in avia-sticky-header.js relevant for loading the logo from the theme’s transparency settings on mobile?
Hi :-) The svg is loaded as image!
function avf_no_inline_svg_mod($attachment_id, $url) { $logo_url = avia_get_option( 'logo' ); $logo_url_transparency = avia_get_option( 'header_replacement_logo' ); if ($url && $url == $logo_url || $url && $url == $logo_url_transparency) { return true; } return false; } add_filter('avf_no_inline_svg', 'avf_no_inline_svg_mod', 10, 2);
That works as expected on larger screens. But not on mobile. If the header is fixed and shrinking on mobile too. That’s why I changed the avia-sticky-header.js with a code from you, found in the forum.
Hi Mike, as I said: It is not about the small round one. Everything finde with that. And it is not about a transparent background either. The logo in the header is different for the mobile versions and the desktop version. For the desktop version (above 990px) the logo is white (as defined in the theme’s transparency settings) and for the mobile/smaller versions it is blue – that is the normal logo, not the one defined in the theme’s transparency settings. Now my question is: Why? Is anything of the transparency logic defined in avia-sticky-header.js? Than this could be the reason, because I altered the avia-sticky-header.js
Hi Mike,
it is about the logo that changes in header before scroll. After scroll everything is fine. Before scroll there is a white logo (the one defined for transpareny mode) shown on large screen sizes (white). On smaller screens the transparency mode logo is overruled by the normal one (blue).
I think I can sort it out with css but am curious if there is an error in the filter (see above) or is it because of the altered avia-sticky-header.js.
All the best,
DanielNo, I did not remove it. Just go below 990px width. Than the alternate logo part is hidden by
display: none
.The longer I think about it I think the problem isn’t the filter. It is because of the changes in avia-sticky-header.js and that those aren’t reflecting the two different logo types …
Hi Ismael,
on an other page I have the header on mobile sticky and transparent too (avia-sticky-header.js). See link.
Hi Ismael,
I tried to add the gallery function like that:
(function($){ $(document).ready(function() { $('.test').magnificPopup({ type: 'iframe', gallery: { enabled: true }, iframe: { markup: '<div class="mfp-iframe-scaler">'+ '<div class="mfp-close"></div>'+ '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+ '<div class="mfp-title">Some caption</div>'+ '</div>' }, callbacks: { markupParse: function(template, values, item) { values.title = item.el.attr('title'); } } }); }); })(jQuery);
And it works! Images and videos mixed in a lightbox gallery as iframes with titles below each entry. Only the arrows look different to the usual ones from the lightbox, but I can sort that out with CSS I think.
Thank you for helping me out!
All the best,
DanielMay 28, 2025 at 8:59 am in reply to: Problem to unlock “Lock advanced layout builder” for editor #1484761Hi Günter,
I replaced the old code with yours on multiple installs and everything works as expected. The editors can use the ALB and load templates from the dropdown again. Thanks a lot!
Kind regards,
DanielMaybe it is sufficient to add:
gallery: { enabled: true }
Could that be possible?
-
This reply was modified 1 month, 1 week ago by
spooniverse.
Hi Ismael,
thanks for your link. This works: https://codepen.io/dimsemenov/pen/kXGxJv
But: The arrows ar missing again. We are one big step further and have JPG and MP4 with captions and opening in lightboxes. How can I have them grouped with arrows to go from one to the next?
<div class="isotope"> <a class="test" title="Test title1" href="xxx.mp4?iframe=true">Vid1</a> <a class="test" title="Test title2" href="xxx.mp4?iframe=true">Vid2</a> <a class="test" title="Test title3" href="xxx.jpg?iframe=true">Img1</a> </div>
Script:
(function($){ $(document).ready(function() { $('.test').magnificPopup({ type: 'iframe', iframe: { markup: '<div class="mfp-iframe-scaler">'+ '<div class="mfp-close"></div>'+ '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+ '<div class="mfp-title">Some caption</div>'+ '</div>' }, callbacks: { markupParse: function(template, values, item) { values.title = item.el.attr('title'); } } }); }); })(jQuery);
Do you have an idea how to merge the lightboxes as you have done with your script before?
Kind regards,
DanielHi Ismael,
it still is not working as expected. Now the arrows are back, I can go from one slide to the other, even with mixed media (image / video). But it is missing the title for videos. Can I somehow show titles for images and videos?
And: It would be fine for me to add ?iframe=true to all linked media, in fact it would be easier this way. But I am finde with whatever fits your solution.
Quick note: You specified the title twice in you HTML.
Best regards,
DanielHi Ismael,
this works! But: For images only. I use the iframe=true for mixing images and videos. Should have made that clearer:
<div class="isotope"> <a alt="CUSTOM ALT HERE" title="CUSTOM TITLE HERE" class="inline_popup" href="xxx.img?iframe=true"> 01 </a> <a alt="CUSTOM ALT HERE" title="CUSTOM TITLE HERE" class="inline_popup" href="xxx.mp4?iframe=true"> 02 </a> </div>
So I am back to your script because it works for images and videos but breaks the possibility to click from 01 to 02 – any idea on how to keep the arrows linking to the next frame working?
Best regards,
DanielMay 21, 2025 at 4:33 pm in reply to: Problem to unlock “Lock advanced layout builder” for editor #1484532Hi Ismael,
I do have the problem on multiple installs right now. The editor can “edit_posts” and I still get the error …
You find the login details in private.
The settings are:
• Deactivated ALB for everyone exept admin
• Code in functions.php to allow it for admin AND editor
• Without “remove_filter” because change in 2021 (see above)
• Both have “edit_posts” capability
• Error occurs only in Enfold 7Hope you find a solution. Thanks in advance!
Best regards,
DanielNice! Thank you Ismael, now I can load the title. But: The connection to the next images is broken! I have more pictures, connected as lightbox gallery like that:
<div class="isotope"> <a alt="CUSTOM ALT HERE" title="CUSTOM TITLE HERE" class="inline_popup" href="xxx.img??iframe=true"> 01 </a> <a alt="CUSTOM ALT HERE" title="CUSTOM TITLE HERE" class="inline_popup" href="xxx.img??iframe=true"> 02 </a> </div>
With your code only the first image loads in a lightbox. The arrows to navigate from 01 to 02 are missing.
Can you fix that?
All the best,
DanielMay 20, 2025 at 9:29 am in reply to: Problem to unlock “Lock advanced layout builder” for editor #1484486Hi Ismael,
see your post #1276219. I asked in 2021 because the line
remove_filter
destroys the code and again everyone is able to use ALB. You suggested to delete the first line and in this way it worked for years. And it still does, but right now the users besides administrators can’t access the ALB templates from the dropdown.And they even get the error message when I add the
remove_filter
line to the code. It is like that:With
remove_filter
: Everyone can use ALB exept templates
Withoutremove_filter
: Only the user roles from the arry can use ALB exept templatesSeems as if there are certain rights necessary to use the templates and those rights aren’t granted with the function. What do you think?
Cheers,
DanielHi Ismael,
nice idea! I tried it (see code) but it sadly didn’t work. The iframe lightbox has no title container at all. If I inspect the lightbox of a gallery I see a div for the title. There is no such div with an iframe lightbox …
Can I somehow get the iframe lightbox to show it?
Best regards,
DanielHi Kriesi,
das ist doch gut zu wissen. Danke für die Info in Bezug auf euer Vorgehen. So können wir als User entsprechend planen.
Eine Empfehlung eurerseits im Backend oder Changelog in Bezug auf ein Plugin, welches ihr empfehlt, wäre super. Dann wissen wir als Endanwender, dass damit eine gute Kompatibilität gegeben ist. Danke!
Und danke auch für eure Arbeit, am Theme und hier im Forum.
Viele Grüße,
DanielMay 16, 2025 at 3:34 pm in reply to: Add caption in lightbox under image in masonry gallery #1484346Hey @Ismael and @Guenni007,
I found this old thread of yours and I am wondering if I could even load a title for a lightbox if the lightbox contains an image from the media library?!
Example: I have a link in a text like
https://homepage.de/wp-content/uploads/image.jpg?iframe=true
to show the image in a lightbox. Everything works as expected, the lightbox opens the image from the library in an iframe. But no title, description or whatsoever.Any idea on how to get the title displayed with an
?iframe=true
link?All the best,
DanielBut could I somehow disable the SVG icons? I have some pages with a lot of icons and different colors for them set in CSS as
color:
. Now I would have to change that tostroke:
or am I wrong?Best regards,
DanielNice! That is the final code I am using to load only the logo as SVG-file and use SVG paths for the rest:
function avf_no_inline_svg_mod($attachment_id, $url) { $logo_url = avia_get_option( 'logo' ); if ($url && $url == $logo_url) { return true; } return false; } add_filter('avf_no_inline_svg', 'avf_no_inline_svg_mod', 10, 2);
Nice! Pretty shure I tried this and it didn’t work but never mind. Glad about the code. Thanks! You can delete the linked image.
A last question about the hook: Can I somehow load the logo url from the theme settings? In the Enfold theme options I link to the logo file and if I could refer to the given path there I would not have to change it in the code in the functions.php. Like:
$logo_url = URL FROM THEME OPTIONS;
Any chance to do so?
All the best,
DanielSorry, I tried different itterations but none of them loads the logo as file. I don’t want the logo to be loaded as path. How can I achieve that?
Hi Ismael,
that is the right direction. How can I write the
if
part if the logo is not in the library? Because I don’t have a ID for the logo …Any idea?
All the best,
DanielHere I got the code from Rikard: Post #1327639
Is there a hook to tie it only to the logo?
-
This reply was modified 1 month, 1 week ago by
-
AuthorPosts