• Resolved auhippo

    (@auhippo)


    Its really a cool plugin to start a forum. I like all the features. I wanna show the ads in forum threads, at top of categories. Could you guide me on where i have to insert adsense code to display ads?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi
    Use hooks
    asgarosforum_{current_view}_custom_content_top
    asgarosforum_{current_view}_custom_content_bottom

    Thread Starter auhippo

    (@auhippo)

    @yworld,
    Where can i find it?
    Could you kindly elaborate where i have to paste the adsense code?

    • This reply was modified 7 years, 3 months ago by auhippo.
    Plugin Author Asgaros

    (@asgaros)

    Hello @auhippo

    You can add custom code/logic with this example, which you have to place in your themes functions.php file:

    function my_custom_content() {
        // Your adsense code/logic ...
    }
    add_action('asgarosforum_overview_custom_content_top', 'my_custom_content');
    riseagainst

    (@riseagainst)

    Hello @asgaros. I’ve added the code as suggested, however, for me, the ad only seems to display on the forum’s index page. Any ideas?

    function my_custom_content() {
    ?>
      // Your adsense code/logic ...
    <?php	
    }
    add_action('asgarosforum_overview_custom_content_top', 'my_custom_content');
    Plugin Author Asgaros

    (@asgaros)

    @riseagainst

    If you want to show the content in other locations you can change the name of the view:

    For example:
    asgarosforum_overview_custom_content_top
    asgarosforum_forum_custom_content_top
    asgarosforum_thread_custom_content_top
    etc

    Perfect!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Insert adsense code in forum’ is closed to new replies.