Tagged: 

Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1348504

    Hello,

    As you guys are also using bbpress, I’ve been trying to figure out how to add a banner on the top of the forum pages. Can I do it by adding a code somewhere in the pages section or theme settings? As the forum page is created but I cannot find it in the pages to edit.

    KR,

    Michael

    #1348574

    Hey babyboymik,
    Please try the Ads for bbPress plugin, with it you can add html or javascript on top and bottom of each page and between topic and reply lists.

    Best regards,
    Mike

    #1348641

    Hello Mike,

    I’ve checked and see this plugin doesn’t have many users and the rating is not so great. That’s where I become a little skeptical for security reasons and functionalities with the latest WordPress software. As a newbie with WordPress, would you still recommend this? Is there any other way to go about this?

    Thanks again!

    KR,
    Mike

    #1348644

    Hi,
    In my research it seems that you can go to Dashboard>forums>all forums and edit each forum and put the banner in the description.
    The same answer suggested the plugin alternative: bbp style pack
    I don’t have much experience with bbpress and can’t access the admin backend of the plugin here, it’s a custom setup.

    Best regards,
    Mike

    #1348648

    Hi,

    Unfortunately, I can’t add a banner on the main page of the forum on top, where all forums are shown. I will try putting one in the description but I doubt it will add it on the page of that specific forum. It will just add it along with the description of the forum page. Will check out the plugin though. Thanks again.

    BR,
    mike

    #1348651

    Hi,
    Do you only want it on the one /forums/ page above the search bar?
    I might be able to inject it there with javascript, but I’d need to see the code for the banner and add it to your child theme.
    Are you going to want two banners, one for mobile and one for desktop in this spot?

    Best regards,
    Mike

    #1348655

    Hello,

    I would like to add a banner on the main forum page and each of the main forum sections created (links of each in private), and yes one for mobile and one for desktop.

    I don’t use a child theme. Is that needed for this? Is it difficult to create a child theme?

    BR,
    Mike

    #1348689

    Hi,
    You will want to use a child theme otherwise the customization will be lost on the next update, please see our documentation for installing a child theme.
    After you set this up, please include an admin login in the Private Content area below so we can look at creating a script for the 7 pages.

    Best regards,
    Mike

    #1348704

    Hello again,

    Thanks for the guide-through. I have followed the instructions and installed the child theme with copying & exporting. All seems well.

    I have posted a link in private with a temporary log-in link…

    BR,
    Mike

    #1348791

    Hi,
    Thank you for the login, I see that your banners are added as custom widgets, but I notice that your child theme is not activated
    2022-04-19_003.jpg
    please activate the child theme and import the parent theme settings.
    Also note that any customizations in the parent theme functions.php will need to be moved to the child theme functions.php so they will not be lost on updates.

    Sometimes, after importing the parent theme settings into the child theme and clearing your caching plugins, the site doesn’t show the style correctly, in this case go to the theme settings and see if the “save all settings” button is blue:
    2022-04-19_004.jpg
    If so click it to save again and clear your caching plugins and check again.
    If the button is not Blue, try adding a space in the Quick CSS, this will make the button blue so you can click to save again.
    Otherwise, try disabling your caching plugin and clear your browser cache and check again.

    Best regards,
    Mike

    #1348840

    Hey Mike,

    I already exported it. I just activated the parent theme before I logged out. Just to make sure, the child theme should always be activated, correct?

    Also as far as the banner ads are concerned. I added them as widgets and add the shortcode of the widget on the code block for each. Is there a way to just take the HTML code from the widget and add it in forums as we said?

    I posted the code for the main top banner in private..

    Thanks again.

    KR,
    Mike

    #1349046

    Hi Mike,

    Yes, child theme should be always activated.

    Please add following code to bottom of Functions.php file of your child theme in Appearance > Editor

    function av_add_bbpress_custom_content() { 
    	echo 'YOUR SCRIPT GOES HERE';
    }; 
    add_action( 'bbp_template_before_forums_loop', 'av_add_bbpress_custom_content', 10, 0 ); 
    add_action( 'bbp_template_before_topics_loop', 'av_add_bbpress_custom_content', 10, 0 ); 

    Regards,
    Yigit

    #1349590

    Hello Yigit,

    The code doesn’t seem to be working. I put it as you said with the script provided before…

    #1349652

    Hey,

    Could you please create temporary admin logins and post them here privately so we can look into it? I tested it on my local installation and it worked for me :)

    Regards,
    Yigit

    #1349878

    Hello Yigit,

    Yes, it works! I checked again.

    Just a few more things regarding this.

    I sent two screenshots in private of the two changes I need. The code you gave me for some reason is placed below the search of the main forum page.

    1. How can I place it over it with some padding space on top and bottom?
    2. On the topics pages, the banner is placed right on top of the topics boxes. How can I get some spacing between that?
    3. How can I disable links in the comments boxes? Ive tried a couple of codes such as:
    remove_filter( ‘bbp_get_reply_content’, ‘bbp_make_clickable’, 4 );
    remove_filter( ‘bbp_get_topic_content’, ‘bbp_make_clickable’, 4 );
    but doesn’t work :(
    4. Lastly, how do I get the mobile banners being displayed on small devices and the one I added which is a banner for larger device screens to show up only there?

    Thanks a bunch :)

    KR,
    Mike

    #1350174

    Hi Mike,

    1- Please change your code to following one

    function av_add_bbpress_custom_content() { 
    	echo 'YOUR SCRIPT GOES HERE';
    }; 
    add_action( 'ava_after_main_title', 'av_add_bbpress_custom_content', 10, 0 ); 
    add_action( 'bbp_template_before_topics_loop', 'av_add_bbpress_custom_content', 10, 0 ); 

    bbPress does not seem to have a hook before search form, the ones I tried did not work but this should work. This would add your banner below title bar. You can then add following code to bottom of Quick CSS field to position it in center

    #b32654dbd97de {
      margin: auto;
    }

    If that does not work, please post a link of your page.

    2- Please add following code to Quick CSS

    #b32654dbd97de {
      margin-bottom: 30px;
    }

    3- Could you please refer to this post – https://bbpress.org/forums/topic/how-to-disable-hyperlinks-in-bbpress-forum/?

    4- You can use – https://developer.wordpress.org/reference/functions/wp_is_mobile/ function to set different banners :)

    Best regards,
    Yigit

Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.