WordPress.org

Ready to get started?Download WordPress

Forums

AppPresser - Mobile App Framework
[resolved] dyname page loading (13 posts)

  1. martinbeasnunez
    Member
    Posted 7 months ago #

    I want to disable the ajax load for a specific page

    any suggestions?

    Thank you.

    http://wordpress.org/plugins/apppresser/

  2. Michael Beckwith
    Member
    Plugin Author

    Posted 7 months ago #

    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' );
  3. martinbeasnunez
    Member
    Posted 7 months ago #

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

    ):

  4. Michael Beckwith
    Member
    Plugin Author

    Posted 7 months ago #

    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' );
  5. martinbeasnunez
    Member
    Posted 7 months ago #

    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

  6. Michael Beckwith
    Member
    Plugin Author

    Posted 7 months ago #

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

  7. martinbeasnunez
    Member
    Posted 6 months ago #

    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!

  8. Michael Beckwith
    Member
    Plugin Author

    Posted 6 months ago #

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

  9. martinbeasnunez
    Member
    Posted 6 months ago #

    http://i.imgur.com/7Tk8ZB2.png

    I'm going crazy jaja ):

  10. martinbeasnunez
    Member
    Posted 6 months ago #

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

    if you go to 'chat' you'll not load the chat
    but if you go directly to

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

  11. Michael Beckwith
    Member
    Plugin Author

    Posted 6 months ago #

    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. :)

  12. martinbeasnunez
    Member
    Posted 6 months ago #

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

  13. Michael Beckwith
    Member
    Plugin Author

    Posted 5 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.