# Announcing WordPress plugin to display any data from Discourse

**URL:** https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968
**Category:** Marketplace
**Created:** [11.Июль.2015 05:33:26 UTC](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968 "2015-07-11T05:33:26Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [11.Июль.2015 05:33:26 UTC](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968/1 "2015-07-11T05:33:26Z")

</div>

### Finally, a universal WordPress plugin that fetches anything from Discourse and outputs it in your blog.

Dear Discourse community!

I have been using Discourse for almost 2 years, mostly combining it with WordPress.

As a result, I ended up creating a WordPress plugin that lets me display any JSON data with using an easy to learn [Twig syntax](http://twig.sensiolabs.org/).

Recently, I put some effort to teach the plugin fetching data from WordPress’ underlying MySQL database and use the same Twig syntax to output the data fetched.

These two features combined so well and covered so many cases that I decided to put some effort to polish it, create a tiny website and make it available on the marketplace.

###Please welcome - [Twig Anything](https://twiganything.com) plugin for Wordpress + Discourse and much more

* * *

**Example 1**. Top 5 most liked users this week

![](https://global.discourse-cdn.com/meta/original/3X/b/c/bcd91a9a0f224ff4262e6c9a4f53b138dee4142b.png)

* * *

**Example 2**. Howto topics discussed now:

![](https://global.discourse-cdn.com/meta/original/3X/4/c/4c25ae82bf239d5b3c7b9f44b2394ea8ba69f26d.png)

* * *

**Example 3**. Latest topics from a particular category (in Russian) - [see it live](http://kozovod.com/)

![](https://global.discourse-cdn.com/meta/original/3X/e/8/e81cc90c0bca273f83469ee1fe5f092a4437b481.png)

* * *

**Example 4**. Forums leaderboard with various statistics (in Russian) - [see it live](http://kozovod.com/honours-board/)

 ![](https://global.discourse-cdn.com/meta/original/3X/0/b/0b591934abc0adcede7b2b1da1737c9da9504faa.png) 

* * *

# How it works

Firstly, the plugin adds `Twig Templates` section to your WordPress:

 ![](https://global.discourse-cdn.com/meta/original/3X/5/7/57e9bd92cd166f58f61f0e32f1c9589e550d9d01.png) 

* * *

Next, for every template, you configure what data you want to fetch from Discourse and whether to cache it and for how long:

 ![](https://global.discourse-cdn.com/meta/original/3X/c/d/cdaa7f459ce7758ebd9f2b3f03e1e2752b1b919a.png) 

* * *

Finally, you create a simple HTML template with Twig syntax. you have full control of how the data is displayed. Here is a simple example of how it looks in WordPress:

 ![](https://global.discourse-cdn.com/meta/original/3X/9/b/9b17d77455845a0a44c3c1473507e12b565d588a.png) 

Twig can do many things for you: filter and slice arrays, transform strings, call some PHP functions safely and much more. That’s why I selected Twig to display the data.

* * *

When you have finished creating your Twig Template and is happy with the output (by clicking the Preview button), you can now copy the shortcode and use it anywhere in WordPress: in posts, pages, headers, footers, widgets etc:

![](https://global.discourse-cdn.com/meta/original/3X/a/d/addc751c1c195eb1f40a69e8d6881b301d782e66.png)

# Tutorial and more demos

Here are [a few demos](https://twiganything.com/integrate-discourse-and-wordpress/) showing real live data from Discourse Meta.

Here is an [illustrated step-by-step guide](https://twiganything.com/tutorial-display-data-from-discourse-in-wordpress/) for retrieving data from Discourse and displaying it in WordPress.

# How to get the plugin

The plugin is not free, but it is not expensive either - just $37 for a single WordPress setup (multisite included). This includes:

- unlimited use with a single WordPress installation
- full source code
- 1 year free updates
- 3 months support

_P.S. I’m very confident regarding the price - the high quality code is covered by my 10+ years experience developing in PHP, including for WordPress. I know how the high quality plugin can make the difference. So if you need the plugin, I’m asking you to appreciate my effort and accuracy and love that I put into it. Buying the plugin will also help me to evolve it further based on the feature requests of the community._

# Your feedback and feature requests

For Discourse users, I’d happily answer and questions and take any feature requests right in this thread. Otherwise, you’ll find a simple support system right on the website.

* * *

# Afterword

I’m very interested in what community thinks of this plugin, how you would use it and on which website. Please let me know! I can’t wait seeing it in action. After all, there have been no complete JSON-rendering plugins for WordPress - before today, and that’s why I made it.

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [23.Январь.2016 14:40:57 UTC](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968/4 "2016-01-23T14:40:57Z")

</div>

# Version 1.6.2

A minor update was released today - version 1.6.2.

2 more functions were made available in Twig Templates:

- `get_post_meta` - utilizes the native WordPress function with the same name
- `get_current_post_meta` - the same but does not require you to pass the post ID as its first parameter, and instead uses the ID of the current post in the WP loop.

A real use-case utilizing the new plugin feature with a step-by-step tutorial can be found here:

[http://forum.twiganything.com/t/add-existing-discourse-topic-to-a-wordpress-post-with-twiganything/27](http://forum.twiganything.com/t/add-existing-discourse-topic-to-a-wordpress-post-with-twiganything/27)

The main point of the tutorial is the ability to dynamically build URL to query Discourse for comments based on a topic ID, which can be stored in a custom post field and retrieved by the `get_current_post_meta` function, see the Data URL field:

 ![](https://global.discourse-cdn.com/meta/original/3X/9/4/94be8f7d1f5677fc07a518522f91663fb0ef9e53.png)

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [13.Март.2016 06:48:16 UTC](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968/5 "2016-03-13T06:48:16Z")

</div>

# Version 1.6.3

Another update is here, which gives birth to endless WordPress/Discourse integration options, thanks to the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin.

See a tutorial which goes through all steps in one interesting use-case:

> [@Display Data Explorer query results in WordPress (with TwigAnything)](https://meta.discourse.org/t/tutorial-display-data-explorer-query-results-in-wordpress-with-twiganything-1-6-3/40956):
>
> [Data Explorer](https://meta.discourse.org/t/data-explorer-plugin/32566) plugin lets us extract and explore about any data from Discourse. In this tutorial I’ll show you how to display it in WordPress, like this: The data can be displayed in posts/pages, widgets or in Visual Composer blocks The data is optionally cached in WordPress You have full control on how data is output. In this tutorial we will use [Twig Anything](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968) WordPress plugin (I’m the plugin author) Use-case So, let’s build a list of topics from particular categories published in…

2 main updates in this version:

- Add GET/POST selector to URL Data Source
- Update React.js library to version 0.14.7

 ![](https://global.discourse-cdn.com/meta/original/3X/c/5/c5ac3c6157b2c0eb93351a7765ea0db44c4e6889.png)

---

<div class="post-metadata">

### Author: ![JoelZaslofsky](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joelzaslofsky/32/158556_2.png) [@JoelZaslofsky](https://meta.discourse.org/u/JoelZaslofsky)
#### Post date: [06.Июль.2016 18:25:44 UTC](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968/6 "2016-07-06T18:25:44Z")

</div>

Are you still actively developing and supporting this plugin, @meglio? If so, I’d consider using it for an upcoming WordPress/Discourse combined platform that my community is starting to develop.

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [06.Июль.2016 23:29:36 UTC](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968/7 "2016-07-06T23:29:36Z")

</div>

Yes I do support, and I use the plugin for my own WP/Discourse integration.  
Other live websites are also using this plugin. For example, [pyxeldynamo](https://www.pixeldynamo.com/).  
Not actively developing new features right now, but it is stable and does what it claims to very well.

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [05.Декабрь.2017 03:30:28 UTC](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968/9 "2017-12-05T03:30:28Z")

</div>

# Version 1.6.5

I’ve been successfully using Twig Anything for more than 2 years now to let our complementary WordPress website ([kozovod.com](http://kozovod.com)) show various data from our Discourse instance ([forum.kozovod.com](http://forum.kozovod.com)).

More than 100 websites started using the plugin since the very first release.

It’s time to make a maintenance and stability improvement release. Version 1.6.5 is now available:

_Please note that there is no v. 1.6.4. The previous version is 1.6.3_

It brings no new functionality to the plugin, yet existing customers are encouraged to update in order for the plugin admin area to work in the latest Google Chrome browser and with other WordPress plugins / themes that use the same libraries behind the scenes, like e.g. Avada theme.

Here is the full list of updates:

- **Update CodeMirror library to v. 5.32.0**  
(the existing bundle stopped working  
for the latest Google Chrome browser version)

- **Wrap `CodeMirror` library** to prevent conflicts with `CodeMirror` instances  
loaded by other WordPress plugins or themes

- Toggle **CodeMirror full screen mode** by Ctrl-Enter rather than F11  
(F11 has a different purpose in MacOs)

- **Use `Clipboard.js` library** instead of unsupported and outdated `ZeroClipboard`

After logging into your account at Twig Anything website, download the latest version from [https://twiganything.com/download-twig-anything/](https://twiganything.com/download-twig-anything/). The price has also been increased to $59 to better reflect the time spent on the support.

Also, here is a new tutorial on [how to display a newly registered Discourse users in WordPress](https://meta.discourse.org/t/display-data-explorer-query-results-in-wordpress-with-twiganything/40956/4), like this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/2/a2a6bbcbd60c91e38078721f66492675c6ff607e.jpg)

---

<div class="post-metadata">

### Author: ![PatrickH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrickh/32/116296_2.png) [@PatrickH](https://meta.discourse.org/u/PatrickH)
#### Post date: [03.Февраль.2019 20:31:00 UTC](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968/10 "2019-02-03T20:31:00Z")

</div>

Are you still actively developing and supporting this plugin @meglio ?  
I would like to use this to show some stats, like this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/4/d4ba91e90ba8ce09a87dac24bdfd0db2dabef46f.png)

Is that possible ?

---

<div class="post-metadata">

### Author: ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)
#### Post date: [13.Март.2019 05:25:42 UTC](https://meta.discourse.org/t/announcing-wordpress-plugin-to-display-any-data-from-discourse/30968/11 "2019-03-13T05:25:42Z")

</div>

Yes it is possible.

Please see my reply here:

> [@Twig Anything – Show any data from Discourse in Wordpress – an Open Source WordPress plugin](https://meta.discourse.org/t/twig-anything-show-any-data-from-discourse-in-wordpress-an-open-source-wordpress-plugin/84793/19):
>
> I’m using the plugin on my own websites, and it is working okay, but I haven’t been developing new features for a while. The plugin has been [open sourced](https://bitbucket.org/meglio/wp-twig-anything) some time ago, so feel free to give it a try. Contributions are welcome.
