Viewing 12 replies - 1 through 12 (of 12 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    See if this works.

    function my_custom_callback( $classes ) {
        //$classes is an array.
        $classes[] = 'no-ajax';
        //return it back to the filter so it can be applied
        return $classes;
    }
    add_filter( 'body_class', 'my_custom_callback' );
    Thread Starter martinbeasnunez

    (@martinbeasnunez)

    ok, that’s fine,
    but I need to disable for a specific page

    ):

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    function my_custom_callback( $classes ) {
        global $post;
    
        if ( is_page( 'ENTER PAGE SLUG OR ID HERE' ) {
            $classes[] = 'no-ajax';
        }
    
        //return it back to the filter so it can be applied
        return $classes;
    }
    add_filter( 'body_class', 'my_custom_callback' );
    Thread Starter martinbeasnunez

    (@martinbeasnunez)

    function my_custom_callback( $classes ) {
        global $post;
        if ( is_page('chat')) {
            $classes[] = 'no-ajax';
        }
        //return it back to the filter so it can be applied
        return $classes;
    }
    add_filter( 'body_class', 'my_custom_callback' );

    doesn’t work

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    i’d keep tinkering with that one, it’s on the right path. May not be pulling in the $post correctly. Worth exploring though.

    Thread Starter martinbeasnunez

    (@martinbeasnunez)

    I’m sure the slug of my page is ‘chat’, I do not understand that I’m doing wrong

    I’m about to upload my first application with apppresser but this bug is limiting me,
    any other suggestions?

    thank you!

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    can you confirm the class is ending up on the body tag?

    Thread Starter martinbeasnunez

    (@martinbeasnunez)

    View post on imgur.com

    I’m going crazy jaja ):

    Thread Starter martinbeasnunez

    (@martinbeasnunez)

    My url:
    https://martinbeasnunez.com.ar/app/

    if you go to ‘chat’ you’ll not load the chat
    but if you go directly to

    https://martinbeasnunez.com.ar/app/melian/chat/
    works

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Well, that answered half of the issue. As you can see with the following:

    <body class="page page-id-68 page-child parent-pageid-9 page-template-default no-ajax not-logged-in">

    The class is actually getting added. However, that brings up a different issue of the no-ajax class not working like it should. That said, I’ll get this filed as an issue and we can look into it. Do remember we’re still in beta so bugs like this can be expected. ??

    Thread Starter martinbeasnunez

    (@martinbeasnunez)

    Sure, I understand
    To launch this release, I think disable the dynamic load on the app, it will be better
    Thanks

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    As followup, I was incorrect about how the no-ajax class was meant to work.

    You add that class to the <a> links themselves, and the urls that the class is added to will load normally.

    Hope that clears confusion up for anyone who may be coming around here.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘dyname page loading’ is closed to new replies.