WordPress.org

Ready to get started?Download WordPress

Forums

Advanced AJAX Page Loader
CSS gets messed up after Ajax page load (3 posts)

  1. roolandb
    Member
    Posted 1 year ago #

    I read that if ajax jquery call is used then all scripts should be reloaded again, for that the plugin have a place where I should put those codes. Until that everything works correctly, except one thing. When I go from a category to category, everything works fine, but when I open a single Post it completely screws up all my css for that page, when I refresh it, everything looks fine but then again, if I open one of the big categories with many posts in it, then that pages css is messed up.

    I though that I could somehow refresh whole css by putting some code in the "Reload code" box, but I have no idea how to do that using scripts. English isn't my native language, therefore I'm having difficulty finding my answer on google and here, I tried, but my vocabulary is limited. How can I do it?

    http://wordpress.org/extend/plugins/advanced-ajax-page-loader/

  2. rrmia
    Member
    Posted 7 months ago #

    Hey! let me know if you found a solution to this,

    Greatly appreciate it!

  3. wireframed
    Member
    Posted 6 months ago #

    The reason this happens is most likely that the classes WordPress puts on the body tag aren't refreshed. Since the <body> is outside the ID the plugin is refreshing with AJAX, it only gets updated when you force an update (which reloads the entire HTML from the server).

    I had the same issue with a WooCommerce shop I'm building, and am hoping that maybe the plugin author has/creates a solution.
    Getting the body classes updated is kinda important for a lot of themes, since it enables you to do better CSS.

    A possible workaround could be to place the PHP tag that fetches the classes on an element inside the #content (or whatever ID you use for the AJAX update), but it's a bit hacky, and won't work if you need to use the classes for something outside that ID...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags