Genesis Featured Posts Combo Plugin

Hi there
I am trying to use the Genesis Featured Posts Combo plugin on a page with BB and the ajax’d pagination isn’t working.
http://neilmac.staging.wpengine.com/test-with-bb/
I asked the plugin devs to take a look and they said BB is rendering the shortcode before launching the widget at the front end. They say this was marked as resolved in the BB changelog but is still happening here.
The correct pagination behaviour without BB is currently on the home page
http://neilmac.staging.wpengine.com/
Can you help?
Many thanks

Hey Neil,

Thanks for getting in touch! We might need temporary admin access to the site so we can check. You can send them in via private reply.

Ben

[Content Hidden]

Hi Neil,

Thanks for the info. It’s interesting that they are saying this has been resolved before as I don’t think it has. I did some testing and it looks like their assessment of the issue is incorrect as well.

Unfortunately, it looks like the issue is on their end. Here’s what you can tell them so they can hopefully provide a fix…

The issue appears to be that the pagination script relies on a widget ID being available to work.

jQuery("html, body").delay(100).animate({scrollTop: ( jQuery("#" + widget_id ).offset().top - 45 ) }, 400);

The thing is that widgets are only given an ID if rendered within a sidebar. When using WordPress’ core the_widget function as Beaver Builder does, widgets do not get an ID.

I can recreate this issue outside of Beaver Builder in a child theme by calling the Featured Posts Combo widget using the_widget in a static page template file. So, this appears to be an issue with their implementation being compatible with a core WordPress function. The JS should be able to be reworked so it can function properly without needing an ID.

Let me know if you have any questions. I hope that helps!

Justin

Hi Justin
Thank you very much for that solution.
I’ll pass it on to the plugin devs and hopefully it’ll get resolved.
Many thanks
Neil

Hi, could we have one more look at this problem? It would be good to get it working if at all possible.
I posted Justin’s comment (above) on the plugin support forum - and later on the Genesis Slack channels - and this was the developer’s reply:
http://supports.pwdtechnology.com/forums/topic/beaver-builder-problem/#post-343

Does that make sense? Does it help any?
thanks very much
Neil

Hi Neil,

I took a look at the response and the developer is hard coding the widget ID for that specific widget, which we can’t do because Beaver Builder supports all manner of widgets.

Because Beaver Builder is calling the do_shortcode function and this function is triggering before Widget is launching at front end.

We’re actually not calling do_shortcode at all, it’s being called on the_content filter just as it is for normal WordPress content.

To be honest, it doesn’t seem like this developer wants to help much. WordPress’ codex doesn’t say anything about needing to wrap a call to the_widget in a div with a widget ID. I should be able to do the following, but then the AJAX in their widget doesn’t work because they rely on an ID…

the_widget('Genesis_Featured_Posts_Combo_Widget', 'show_pagination=1&layout=layout-five&limit=4');

It’s possible to rewrite the JS so it doesn’t need a widget ID to work. Can you setup a test page with it again? I’ll whip up a proof of concept that you can bring to them.

Thanks,
Justin

[Content Hidden]

Thanks, Neil.

I’m sure this doesn’t work as it’s just a quick proof of concept as to how the widget can be accessed using JS without the widget ID, but it should get them pointed in the right direction…

function AJAX_PAGINATION(paged){
	
 var link 	= jQuery( this ),
 	 widget = link.closest( '.gfpc-widget' ),
 	 data   = widget.find( 'input[type=hidden]' ).val();

 sdata = JSON.parse( data );
 sdata.paged = paged;
 
 var data = {
    "action"         : "gfpc_ajax_posts_nav",
    "serialize_data" : sdata 
 };
 
widget.toggle( "slow", function() {
    widget.css('top', ( widget.offset().top - 45 ) )   
 });
 
 jQuery.post(WP.AJAX_URL, data, function(data){  
    widget.find('.gfpc-featured-posts').fadeOut(750, function(){
      widget.toggle( "slow");
      jQuery(this).html(data).fadeIn(750);
    });
 });
}

function scrollingContent(){
 var link 	= jQuery( this ),
 	 widget = link.closest( '.gfpc-widget' );
  jQuery("html, body").delay(100).animate({scrollTop: ( widget.offset().top - 45 ) }, 400);
}

The main issue here is that we should be able to do the following but can’t with this widget…

the_widget('Genesis_Featured_Posts_Combo_Widget', 'show_pagination=1&layout=layout-five&limit=4');

From the codex article on the_widget

This template tag displays an arbitrary widget outside of a sidebar. It can be used anywhere in templates.

Hopefully they are willing to help!

Justin

Hey Neil,

Just wondering if you were able to get this resolved with the plugin devs?

Ben

Hi Ben
Thanks for getting back to me on this.
Funnily enough there was a recent update for the Featured Posts Combo plugin and this was in the change log:

1.0.4 = Fixed Conflicting issue with Beaver Builder

So that’s good! :slight_smile:
Many thanks
Neil

Hey Neil,

Thanks for letting us know! One more thing, are you using the shortcode version or the widget?

Ben

Thanks Ben
I was using the widget rather than the shortcode but would you believe it - ! - I’ve temporarily deactivated the plugin as Google was reporting structured data errors.

At least, once I get to the bottom of that separate issue, I’ll know I can use it with BB successfully again.

Thanks
Neil

Hey Neil,

Part of the reason I was doing a follow up on this thread was because we’ve another user having the same problem. I’ll go ahead and file a bug report for this instead so our lead dev can recheck. :slight_smile:

Ben