Home>Support>Post Loop using Ajax

Post Loop using Ajax

By Andy, 9 years ago. Last reply by Ivan, 8 years ago.

Hello,
I’m using PageBuilder and i want to load the pages using Ajax. It’s working but i had a problem using the Post Loop widget, because i get a blank page.

I searched a bit and i found this :
https://github.com/wp-plugins/siteorigin-panels/blob/master/widgets/basic.php#L170

function widget( $args, $instance ) {
		...
		if( is_admin() ) return;
		...

All the Ajax calls must be routed in : /wp-admin/admin-ajax.php. But the

is_admin()
function will always return
true
due to this routing.

I would like to know :
1 – Is there a simpler solution than duplicate the widget and remove this line
2 – Why is this condition checked ?

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 5 months ago Andy

    Hello, i’m always facing this problem, can someone can help me ? Thanks :)

  2. 9 years, 4 months ago Greg Priday
    Hi, I Work Here

    Hi Andy

    Sorry we missed your thread last time.

    The main reason we’re adding in that check in is to prevent the possibility of infinite loops coming up, which was happening in the admin. I’ll look at making that check filterable for use cases like yours. Basically something along the lines of:

    if( apply_filters( 'siteorigin_panels_postloop_skip_render', is_admin() ) ) return;
    
  3. 8 years, 1 month ago Ivan

    Hello Andy,

    I was wondering if you have documented in some place about how to use ajax with Siteorigin. I’m needing to make an ajax pagination of a widget, so if you can share what you have, it should be good in order to get an idea.

    Thanks!!

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More