Forums

Advanced AJAX Page Loader
Retrieve Body Class from DATAA (5 posts)

  1. zumajoe
    Member
    Posted 3 months ago #

    Trying to grab the class names from the loaded content's Body Class (so that I can replace the body class on the current page with what was loaded), I've come up with the following but cannot seem to get this to work:

    classes =  jQuery(dataa).find('body').attr ("class").split(' ');
    
    for(var i=0; i<classes.length; i++){
     console.log(classes[i]);
    }

    Anyone have a clue?

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

  2. jmeffre
    Member
    Posted 2 months ago #

    I'm looking for something like that to change the body class ... did you find the solution ? Thx

  3. MikeSV
    Member
    Posted 2 months ago #

    Looking for a solution to this too. Body classes are EXTREMELY important for my builds.

  4. Courtney Fantinato
    Member
    Posted 1 month ago #

    Any update on this? I need this as well.

    Many themes rely on the different body classes generated by WordPress, they should be able to be updated to the current page...

  5. Courtney Fantinato
    Member
    Posted 1 month ago #

    My work around is to put the WP generated body classes from body_class() on a div inside the #site-wrap div I am using in the "Content Element ID" setting.

    Note that anything (such as classes) on the element you're using for the "Content Element ID", and outside of it doesn't change.

    So if possible for some of you, it is easier to move body_class() from the body element inside what is actually being "refreshed" on the page so that it gets updated and can be used for CSS and PHP, rather than trying to change anything on the body tag.

Reply

You must log in to post.

About this Plugin

About this Topic