• Hi,

    I’m having a trouble using Ajax Load More plugin shortcodes with the classified ads Wpadverts plugin.

    The plugin author suggested contacting you.

    Would you mind looking at the support topic here?

    Basically, as far as I understand I need to figure out how to call the Ajax Load More plugin outside the_content.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi @chinatownlee,
    I beleive the issue is the required WPAdverts shortcodes are (possibly) not being loaded because they are wrapped in an is_admin() conditional on line #560 of wpadverts.php.

    Ajax Load More uses /wp-admin/admin-ajax.php so it requires the shortcodes to be loaded and right now I believe they are blocked.

    I might be wrong, but this FacetWP article explains the issue.
    https://facetwp.com/is_admin-and-ajax-in-wordpress/

    Thread Starter chinatownlee

    (@chinatownlee)

    @gwin could you please look into it?

    I’m certain that this type of plugin – Ajax Load More – is absolutely necessary considering the nature of classifieds plugin, this can directly increase visitor retention.

    If this is just a matter of loading the WPAdverts AJAX actions then you should be able to workaround this by adding the code below in your theme functions.php file

    
    add_action( "init", "late_wpadverts_ajax_init", 1000 );
    function late_wpadverts_ajax_init() {
        if( ! wp_doing_ajax() ) {
            return;
        }
        include_once ADVERTS_PATH . 'includes/ajax.php';
    
        // AJAX filters
        add_action('wp_ajax_adverts_author_suggest', 'adverts_author_suggest');
        add_action('wp_ajax_adverts_gallery_upload', 'adverts_gallery_upload');
        add_action('wp_ajax_adverts_gallery_update', 'adverts_gallery_update');
        add_action('wp_ajax_adverts_gallery_update_order', 'adverts_gallery_update_order');
        add_action('wp_ajax_adverts_gallery_delete', 'adverts_gallery_delete');
        add_action('wp_ajax_adverts_gallery_image_stream', 'adverts_gallery_image_stream');
        add_action('wp_ajax_adverts_gallery_image_restore', 'adverts_gallery_image_restore');
        add_action('wp_ajax_adverts_gallery_image_save', 'adverts_gallery_image_save');
        add_action('wp_ajax_adverts_gallery_video_cover', 'adverts_gallery_video_cover');
        add_action('wp_ajax_adverts_show_contact', 'adverts_show_contact');
        add_action('wp_ajax_adverts_delete_tmp', 'adverts_delete_tmp');
        add_action('wp_ajax_adverts_delete', 'adverts_delete');
        
        add_action('wp_ajax_nopriv_adverts_gallery_upload', 'adverts_gallery_upload');
        add_action('wp_ajax_nopriv_adverts_gallery_update', 'adverts_gallery_update');
        add_action('wp_ajax_nopriv_adverts_gallery_update_order', 'adverts_gallery_update_order');
        add_action('wp_ajax_nopriv_adverts_gallery_delete', 'adverts_gallery_delete');
        add_action('wp_ajax_nopriv_adverts_gallery_image_stream', 'adverts_gallery_image_stream');
        add_action('wp_ajax_nopriv_adverts_gallery_image_restore', 'adverts_gallery_image_restore');
        add_action('wp_ajax_nopriv_adverts_gallery_image_save', 'adverts_gallery_image_save');
        add_action('wp_ajax_nopriv_adverts_gallery_video_cover', 'adverts_gallery_video_cover');
        
        add_action('wp_ajax_nopriv_adverts_show_contact', 'adverts_show_contact');
        add_action('wp_ajax_nopriv_adverts_delete_tmp', 'adverts_delete_tmp');
    }
    
    Thread Starter chinatownlee

    (@chinatownlee)

    Thanks Greg, but the Ajax Load More still doesn’t work 🙁

    Plugin Author Darren Cooney

    (@dcooney)

    @chinatownlee
    Leave me a support message here.
    https://connekthq.com/plugins/ajax-load-more/support/

    With a link to your site please so i can have a look.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Calling the shortcode outside the_content’ is closed to new replies.