Looking for support? You can access the support system via your account.
- This topic has 3 replies, 2 voices, and was last updated 5 years, 7 months ago by .
You must be logged in to reply to this topic.
Looking for support? You can access the support system via your account.
Forums › Forums › Search & Filter Pro › Embed shortcode problems after wordpress update
Tagged: embed, infinite scroll, oembed, results.php, Template, youtube
Hi!
I have a web in development at http://unisonfokus.com/.
It has a filter on the front page with music releases. Before the wordpress update it all worked fine (updated to 4.9.8).
What is happening now is that the posts that appear on normal page load have different HTML than the ones loaded with AJAX and this breaks the layout.
Funny thing is that before the update, all posts looked like non-AJAX (normal loading) ones look now, with Youtube populating the whole div and reacting to responsive layout in a normal way.
Now, they still look ok but upon inspection you can see that a new class in <p> tag was added titled “fluid-video-container” followed by a <span class=”fluid-video”> in which there is the iframe.
All of this is just a result of [embed] shortcode. Also, on those top releases you can not see HTML comments that are in the php template.
AJAX releases (upon infinite scroll trigger or after results reload by filter action) have just a normal <p> tag with not class followed by an iframe. For some reason youtube video does not populate whole div but is narrow. Also, in those posts upon inspection you can see HTML comments.
So it seems that [embed] shortcode renders after wordpress update in a different way on AJAX filter renders, which remained the same, but that “old” render now looks different than it used to look.
BTW, thx for your incredible plugin, it is really great, and really well coded (now that I looked all around it looking for the answer…).
This is complex. WordPress is doing its stuff, as is Search & Filter. I suspect your theme is injecting the class on to the <p>
and also adding the inner span.
It may be doing so via a function that detects the iframes and does it from there. We have a boilerplate javascript that will enable you to run this code again after the ajax refresh, but I do not know what the code is that is being used.
OK, then can you please help with this. If I locate the injecting javascript function, how would you suggest I call it? Does your plugin have an after AJAX reload hook?
This is the basic script (into which you add your code):
<script>(function ( $ ) {
"use strict";
$(document).on("sf:ajaxfinish", ".searchandfilter", function(){
console.log("ajax complete");
// call your function(s) here
});
}(jQuery));</script>
You must be logged in to reply to this topic.
© 2024 Search & Filter Support. All Rights Reserved.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
We also use cookies to store items in your cart as well as allowing your to login on the site.
You can adjust all of your cookie settings by navigating the tabs on the left hand side.
By continuing to use this site, you also agree to our Privacy Policy.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
*Other cookies used for logging in and cart functions will only be used when you use those features and cannot be disabled.
If you disable these cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
More information about our Cookie Policy