Closed LebCit closed 5 years ago
Hi,
thanks for your praise and the extensive illustration of what you're trying to do...
Just a quick question, before we move on:
I believe you could simply hook into e.g. pronto.render
and use jQuery to set the background image to what you want it to be in the event handler...
Hello again, Thanks a lot for your time and quick reply. Honestly, I surfed quickly the docs and some where totally new words for me :joy: just like Pronto events... I'll try to understand first what are those Pronto events and try your suggestion. Thanks a lot again for your time and guidance.
You're very welcome! Just try something like this:
$(window).on('pronto.render', function(){
//jQuery code to set background image
});
Here's some more guidance on what code to place instead of the comment above:
The exciting thing about that approach is, that you can set the variable imageUrl
they use there on the server-side(i.e. PHP), page-specifically.
Therefore, the jQuery code supplied above can remain the same across pages.
Of course, that is a bit of a patch / workaround / somewhat pragmatic, but might be completely sufficient for your use-case.
If not - please post back and we'll debug why the background image is not loading properly in the first place!
Hello,
After a lot of try, I found the simplest and obvious solution.
But this solution works sometimes and sometimes not...
The solution is to call inside the-clean-blog-hero.js
the fullscreen()
function on pronto.render :
BLA BLA BLA
.
.
.
$(window).on('pronto.render', function(){
fullscreen();
});
// Run the function in case of window resize.
$(window).resize(function(e) {
e.preventDefault();
fullscreen();
});
I'll be putting this feature on hold for now. Thanks a lot for your time and suggestions. Staring your plugin. SYA ✋
Hi,
thanks for the star and the kind feedback. Has this issue been solved to your satisfaction?
Thank you, too!
Hello,
First of all, I want to congratulate you for this very nice plugin and say thank you for sharing. I'm a new WordPress theme/plugin developer. I've tried to implement your plugin in my theme. The only problem for now is the following : I have a header background image that is related to the chosen featured image in the post/page or it will fallback to a default one. This header background image is retrieved with AJAX : In the-clean-blog-functions.php
In the-clean-blog-hero.js
I've been struggling to show the correct header background image depending on the actual page. Another note is that the theme uses Unslider slider, the user can choose to activate it or not within the Customizer for the homepage only or for all the site.
If I manage to make Ajaxify works with the theme I'll implement and mention it in the theme description.
Thanks in advance for your time, help and suggestions.