XFCoder :: Latest XF Threads Widget for WordPress

XFCoder :: Latest XF Threads Widget for WordPress 1.0.4.1

No permission to download

gigipmc

Member
gigipmc submitted a new resource:

Latest XF Threads Widget for WordPress - Shows your latest forum threads in a widget on your WordPress installation

The plugin allows you to create "Latest XenForo Threads" widgets on your WordPress installation.

Utilizes the XenForo API, which means that you can also fetch the latest threads of a remote website that isn't on your own server if you want to.​

Uses AJAX for loading the widget content, so as not to interfere with your page load performance.​

Widget options allow you to control exactly what information is being displayed.​

You can...​

Read more about this resource...
 

HenrikHansen

Well-known member
Any change this add-on can be extended so the widget is shown in the blocks-section used when you edit pages and stories? There as a widget section there too, among blocks available, but this widget is not listed there. Unfortunately, I cannot use it as it is, which is a pity.
 

gigipmc

Member
In newer versions of WordPress, legacy widgets are not available by default in the post editor (reference). It is possible to enable the Legacy Widget Block in the post editor using additional code. I will try to add this as an option in the plugin and release a new version (hopefully within the next couple of days).
 

gigipmc

Member
I looked into this. Unfortunately when embedding a widget as a 'legacy widget block' inside a post, there is no access to the widget options - WordPress only allows it to render with the defaults. Since this solution is far from optimal I cannot upgrade the widget to include it, however if you want I can send you the code.

Ideally legacy widgets should be rewritten to be 'blocks', but there is no functional advantage to this when widgets are used as intended (i.e. as widgets, rather than post embeds).
 
Last edited:

NoDRaC

Member
Thank You for plugin. How can i add widget manually in my Custom theme?

Whats the code?

<?php echo do_shortcode("[????????]"); ?>
 

gigipmc

Member
This isn't available out of the box. I suppose you can try using this plugin for example, which should allow embedding widgets inside content using shortcodes. I haven't tested it though so I can't actually endorse it.
 

Cyberclaw

Active member
Any chance this add-on can be extended so the widget is shown in the blocks-section used when you edit pages and stories?

I found an easy way to do this. Use the following Wordpress plugin, which allows you to insert Widgets into pages and posts via shortcode:

Widgets on Pages

So far this is working great.
 
Last edited:

Cyberclaw

Active member
Also, the Ajax call was slowing down my site's loading time by approximately 1 second. I remedied this problem by setting up caching specifically for this page on Cloudflare.

Here is the Page Rule that I created in Cloudflare:
URL: [MY-DOMAIN]/wp-admin/admin-ajax.php?action=xfcoder

Browser Cache TTL: an hour
Edge Cache TTL: 3 hours
Cache Level: Cache Everything

See here for more info:
 

gigipmc

Member
The ajax call is executed asynchronously after the page loads so it cannot slow it down. You may be referring to the total time it takes for the page and then for the widget to load afterwards, in which case yes caching can be useful. It could also be that the plugin you mentioned is somehow rendering things differently.
 

Cyberclaw

Active member
You may be referring to the total time it takes for the page and then for the widget to load afterwards, in which case yes caching can be useful.

Yes, that's what I was referring to. With the caching enabled, the total load time for the page and then the widget is negligible.
 

Curious

Member
This is almost exactly what I'm looking for with one exception -- is there a way to make this specific to a single forum? I would like to have three instances of the widget for three different forums.
 

gigipmc

Member
The XF API doesn't allow filtering threads by forum (you can see the API reference for fetching threads here). It can be done by extending the core API classes to offer that functionality, i.e. with additional custom development (an add-on) on the XF side.
 
Top