Please or Register to create posts and topics.

How do I add recent topics and posts widget?

Hello,

I’ve already tried to understand the doc regarding Wordpress Hooks, but I still need help.
I don’t know exactly where I have to put this and how I have to hook it exactly.

Those are the widgets I want to enable:

  • asgarosforum_widget_recent_posts_custom_content
  • asgarosforum_widget_recent_topics_custom_content

And I’d like to add those two here:

 

I would really appreciate it if somebody is willing to help me.
Thankyou!

nel2912 has reacted to this post.
nel2912

I join the question, I also want to do the same with my forum

No one?

Hello @heyiamsven @nel2912

What you can try to do is to use the asgarosforum_content_header hook to inject the code/shortcode which executes the widget. The following plugin can be used to create a shortcode for a widget:

https://de.wordpress.org/plugins/widget-shortcode/

Afterwards you can try to add something like the following:

function my_widget_output() {
  echo do_shortcode('[your-widget-shortcode]');
}
add_action('asgarosforum_content_header', 'my_widget_output');

You have to add this code to your themes functions.php file.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!