Please or Register to create posts and topics.

Image and description only on main page / hook into template files

The page which has the shortcode [forum] also has an image and a description. How do I prevent to display both on other pages within the forum?

main page: image + description + [forum]
any other page of the forum: [forum]

Is there a way to hook into the template files like this?

forum.php
forum-category.php
forum-single.php

Hi Magma

Add the following code to your themes functions.php file

function FunctionOverviewTop() {

  echo 'your code';
  

}
add_action('asgarosforum_overview_custom_content_top', 'FunctionOverviewTop');

 

Magma has reacted to this post.
Magma

Thanks Yworld for your quick respond.
That works for me!

Hello Magma,

I am glad to hear that the above posted code is working for you. If you need different outputs for different views one day, you can just modify the view-part in the hook-call:

  • asgarosforum_overview_custom_content_top for overview
  • asgarosforum_forum_custom_content_top for the forum-view
  • asgarosforum_profile_custom_content_top for the profile-view
  • and so on …

You can see the identifier of the actual view in the URL inside the view-parameter, for example:

https://asgaros.com/support/?view=profile&id=1

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