Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 1 through 25 (of 32,499 total)
  • Author
    Search Results
  • #247884
    Robin W
    Moderator

    quick response, I’m a UK farmer, so out a lot of the daytime !

    As a ‘quick and dirty’ solution you would need to create the topic

    Then in a new item I’ll add in the dashboard enter the post ID and the Topic ID

    This will then create a new reply.

    It will keep the existing comments.

    from memory bbpress uses ‘anonymous’ for any user that no longer exists, but if you create a ‘deleted user’ I might be able to add that to the code

    #247880
    Robin W
    Moderator

    ok if you can wait a day or 2, then I’ll write a small plugin that will do that, most of the code already exists.

    #247877
    Joakim Nömell
    Participant

    Thanks, Robin — much appreciated.

    Unfortunately, no, I’m not comfortable with code, and definitely not at that level.

    With the plugin you’re suggesting: am I correct in understanding that it does not import existing comments from the original post as replies in bbPress? What I would really like is to move all 78 comments over as replies in the bbPress topic, and ideally be able to delete the original post entirely afterwards.

    I’ve already created the topic itself manually in the correct forum, preserving the original text, date, and author. The only remaining (small 🙂) problem is the replies. And since those 78 comments contain a lot of valuable content, it wouldn’t feel right to start over from scratch in the forum.

    #247876
    Robin W
    Moderator

    Ok, I am just a volunteer who helps out here, I am not a bbpress author, but I have written a number of bbpress related plugins.

    I also took over a defunct plugin called

    Post Comments as bbPress Topics

    I did not write this, I just did enough coding to get it working again.

    if you are code savvy, then function build_topic on line 485 of index.php should give you some code that you could maybe use in a plugin or use the code snippets plugin.

    otherwise if you only have a few posts from which you want 2, you could enable it convert, disable it and then delete the topics (posts) you don’t want.

    #247794
    refugeindhamma
    Participant

    I’m using Kadence theme. I have followed instructions from Kadence support to use a child theme in order to make additional modifications to bbPress. I have also copied all the bbPress & css templates into the child theme.

    Edit:
    Thanks for the shortcode list.

    #247793
    Robin W
    Moderator

    on shortcodes this the list of bbpress ones

    https://codex.bbpress.org/features/shortcodes/

    #247791
    refugeindhamma
    Participant

    I tried to follow the bbPress Codex set up instructions.

    However, when I used Method 1 and created a page called “Forums”, the link sent me to a page with just the word “Forums” and nothing else. But once I deleted the “Forums” page, the link worked by showing the forum index. Is this the right way and the instructions are outdated?

    2nd problem is that if I use Method 2 to create another forum style using another page and use shortcodes to show the forums, e.g. website.com/chats, if I type website.com/forums, I can still access the forums in that way, which is something that I do not want. I tried changing the “Forum Root” under Settings > Forums but it messed up the layout of the “Chats” page that I created using shortcodes. Is there any way to use Method 2 and still not let people access the forums using /forums?

    Edit:
    Lastly, is there a list of all the shortcodes that I can use for the forum? I know there is a list in bbp style pack and bbp Private Groups. Are there more shortcodes that I can use or is that all there is?

    dugenou93
    Blocked

    Bonjour,

    Je me permets de vous contacter concernant un problème d’accessibilité sur le forum BBPress du site rayons.handivelo.fr. Plus précisément, j’utilise le shortcode [bbp-topic-form] pour permettre aux utilisateurs de créer un nouveau sujet.

    Problème rencontré :
    – Je parviens à lire les champs du formulaire avec mon interface vocale, mais la liste déroulante des forums/catégories n’est pas accessible.
    – Mon lecteur d’écran indique qu’il y a 19 éléments dans la liste, mais je ne peux pas les lire ou les sélectionner correctement.
    – Pour information, je suis non-voyant et j’utilise un logiciel de synthèse vocale pour naviguer.

    Questions :
    1. Existe-t-il un autre shortcode ou une alternative pour rendre cette liste déroulante accessible ?
    2. Serait-il possible de remplacer la liste déroulante par des boutons radio ou des cases à cocher pour faciliter la sélection ?
    3. Avez-vous des bonnes pratiques ou des plugins à recommander pour améliorer l’accessibilité des formulaires BBPress ?

    Contexte technique :
    – Site : rayons.handivelo.fr https://rayons.handivelo.fr
    – CMS : WordPress + BBPress
    – Interface utilisée : Lecteur d’écran (ex : JAWS, NVDA)

    Je reste à votre disposition pour tester toute solution que vous pourriez proposer. Merci par avance pour votre aide, et je vous souhaite une excellente année 2026 !

    Bien cordialement,
    Christophe

    #247526
    Robin W
    Moderator

    I am not a bbpress author, I am simply someone trying to help out.

    The slugs do whatever the plugin author codes them to do, and this plugin does not do that.

    You can add this additional plugin

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>shortcodes

    and you can see a shortcode you can use in a page

    [bsp-profile]

    with options for wording and edit

    #247522
    hebhansen
    Participant

    I am aware that forum works. I wonder how to get the user slugs in settings to work?

    User profile
    https://bindesboell.com/fora/users/

    Replies by me
    https://bindesboell.com/fora/replies

    Wil I need to create a page for each user slugs that then has a shortcode on the page?

    #247490
    emere90
    Participant
    add_filter ('bbp_use_autoembed', 'rew_turn_off', 20,1 ) ;
    
    function rew_turn_off ($value) {
    	return false ;
    }

    thanks for this code 😃

    also: https://wordpress.com/support/wordpress-editor/blocks/embed-block/

    #247446
    Robin W
    Moderator

    but still astonished how something like this effect can happen

    I’m just a moderator here – an unpaid volunteer, I’m not a bbpress author.

    There will be a reason for it, and it is almost certainly site specific, no problem on my test site, and with 100,000 installations of bbpress not one I have seen or heard of in 14 years of supporting bbpress.

    The code above is not a ‘fix’, it is just a way to get bbpress to ignore the setting, which allows your site to work.

    Anyway glad you are fixed 🙂

    #247445
    iriteser
    Participant

    added the code, it works

    but still astonished how something like this effect can happen

    #247444
    Robin W
    Moderator

    that would be worth trying.

    untested, but you could first try

    add_filter ('bbp_use_autoembed', 'rew_turn_off', 20,1 ) ;
    
    function rew_turn_off ($value) {
    	return false ;
    }
    #247443
    iriteser
    Participant

    ok, but this will take some time. Currently working in production environment, I have to set up a staging environment and not sure if this works due to memberpress, stripe/paypal connection and so on

    Question: thinking about deactivate Auto-Embeds in WordPress completely with some code – what do you think?

    add_action( ‘init’, function() {

    global $wp_embed;
    if ( $wp_embed instanceof WP_Embed ) {

    remove_filter( ‘the_content’, array( $wp_embed, ‘autoembed’ ), 8 );
    remove_filter( ‘the_content’, array( $wp_embed, ‘run_shortcode’ ), 8 );
    }

    add_filter( ’embed_oembed_discover’, ‘__return_false’ );
    add_filter( ‘pre_oembed_result’, ‘__return_false’ );

    if ( function_exists( ‘remove_filter’ ) ) {
    remove_filter( ‘bbp_get_topic_content’, ‘bbp_topic_content_autoembed’, 2 );
    remove_filter( ‘bbp_get_reply_content’, ‘bbp_reply_content_autoembed’, 2 );
    }
    }, 20);

    #247441
    iriteser
    Participant

    I use Tove from Anders Noren and of course with a child theme

    what do you mean with customized functions? I have a lot of code in my functions.php, but mainly for my customized loops, favorites plugin, styling comment function (not visible for not-logged-in users), Text to speech plugin, memberpress

    nothing with embedded objects

    #247397
    Robin W
    Moderator

    ok, thanks.

    the line of code referred to is looking for a host url on logout from bbpress.

    ‘$redirect_to = bbp_get_url_scheme() . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’];’

    $_SERVER is a php thing and the manual says ‘$_SERVER an array containing information such as headers, paths, and script locations. The entries in this array are created by the web server, therefore there is no guarantee that every web server will provide any of these; servers may omit some, or provide others not listed here. However, most of these variables are accounted for in the » CGI/1.1 specification, and are likely to be defined.’

    Are you maybe running on a local host?

    #247380
    pineapplepalm
    Participant

    Please can something be done about this error on a brand new site install:

    [04-Dec-2025 07:20:05 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:20:05 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:21:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:21:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:21:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:21:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:22:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:22:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:22:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:22:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:23:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:23:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:23:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581
    [04-Dec-2025 07:23:04 UTC] PHP Warning:  Undefined array key "HTTP_HOST" in /home/ourdomainapp/r877.ourdomain.app/wp-content/plugins/bbpress/includes/common/functions.php on line 1581

    Would appreciate some feedback please

    #247201
    Robin W
    Moderator

    I’m pretty sure that the buddypress function hooks to the new_forum_handler in bbpress, so this should work

    add_action( 'bbp_new_forum_post_extras', 'rew_add_pg', 10 , 1) ;
    
    function rew_add_pg ($forum_id ) {
    	 add_post_meta( $forum_id, '_private_group', 'group1', false );
    }

    Let me know of not.

    #246865
    Robin W
    Moderator
    if (!is_admin() ) {
    add_filter( 'bbp_get_forum_content', 'rewst', 10 , 2 ) ;
    }
    function rewst ($content, $forum_id ){
    	if (!empty ($content)) $content= '<a class="bbp-forum-rew" href="'.bbp_get_forum_permalink($forum_id).'">'.$content.'</a>' ;
    return $content ;
    }

    Put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    #246845

    In reply to: SEO Index Forum

    Ricsca2
    Participant

    Thanks a lot, I fixed the code with chatgpt, but it didn’t work well with yoast…

    
    
    /**
     * 🔧 Custom SEO meta tags for bbPress forum index page
     * 
     * This snippet replaces the default "Forum Archive" title and adds custom
     * meta description + Open Graph tags (for Facebook, WhatsApp, etc.)
     * 
     * ✅ Add this code to your theme’s functions.php or a custom plugin.
     */
    
    function custom_bbpress_forum_index_meta() {
        // Check if bbPress is active and we are on the main forum archive page
        if ( function_exists('is_bbpress') && is_post_type_archive('forum') ) {
    
            // 🔹 Custom SEO Title
            add_filter('pre_get_document_title', function() {
                return 'Your Custom Forum Title – Your Site Name';
            });
    
            // 🔹 Custom Meta Description and Open Graph Tags
            add_action('wp_head', function() {
                ?>
                <!-- 🧩 Custom bbPress Forum SEO Meta Tags -->
                <meta name="description" content="Join our forum community! Discuss topics, share experiences, and get expert advice about your favorite subjects." />
                <meta property="og:title" content="Your Custom Forum Title – Your Site Name" />
                <meta property="og:description" content="Join our forum community! Discuss topics, share experiences, and get expert advice about your favorite subjects." />
                <meta property="og:image" content="https://example.com/path-to-your-forum-image.jpg" />
                <meta property="og:type" content="website" />
                <?php
            });
        }
    }
    // Hook into 'wp' to ensure bbPress functions are available
    add_action('wp', 'custom_bbpress_forum_index_meta');
    
    #246843

    In reply to: SEO Index Forum

    Vinay PN
    Participant

    Here are some ways to add or customize the title and meta description for the bbPress forum index:

    1. Use an SEO Plugin That Supports Custom Post Types and Archives
    bbPress forums often rely on custom post types and archive templates.

    Ensure Yoast SEO is configured to handle bbPress custom post types and their archives.

    In Yoast SEO > Search Appearance > Content Types and Archives, check if bbPress forums and topics are enabled and configured properly.

    For the main forum index (bbPress’ main forum page), this is often considered an archive page. Yoast allows customization of archive titles and meta descriptions via the Archives tab.

    2. Add Custom Code via Functions.php or a Custom Plugin
    You can programmatically set the title and meta description on the bbPress forum index with code snippets. For example:

    php
    function custom_bbpress_forum_index_seo() {
    if ( function_exists( ‘is_bbpress’ ) && is_bbpress() && !is_singular() ) {
    // Set custom title
    add_filter( ‘pre_get_document_title’, function() {
    return ‘Your Custom Forum Title – Your Site Name’;
    });

    // Set custom meta description
    add_action( ‘wp_head’, function() {
    echo ‘<meta name=”description” content=”Your custom meta description for the forums index page goes here.” />’ . “\n”;
    });
    }
    }
    add_action( ‘wp’, ‘custom_bbpress_forum_index_seo’ );
    This snippet checks if it’s a bbPress page but not a single topic or forum (index page), then overrides the title and adds a meta description.

    3. Use a Dedicated SEO or Meta Tag Plugin
    Alternatively, plugins like All in One SEO, Rank Math, or WP Meta SEO may provide greater flexibility to add meta tags for archive/custom pages.

    4. Use a Page as a Forum Landing Page Instead of bbPress Default
    Instead of using the default bbPress forum index, you can:

    Create a regular WordPress page.

    Use that page as your main forum landing page.

    Insert bbPress shortcodes or specific forum content there.

    This way, you can edit the page’s SEO title and meta description directly with Yoast.

    website design company bangalore

    #246782

    Please see error code below.

    2025-10-03 11:35:01 Error 77.44.13.228 500 GET /wp-admin/post-new.php?post_type=reply HTTP/1.0 https://www.domainname.org/wp-admin/edit.php?post_type=reply Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 5.70 K Apache SSL/TLS access

    2025-10-03 11:35:06 Error 77.44.13.228 AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size – zend.reserved_stack_size) reached. Infinite recursion? in /var/www/vhosts/domainname.org/httpdocs/wp-content/plugins/bbpress/bbpress.php:169\nStack trace:\n#0 /var/www/vhosts/domainname.org/httpdocs/wp-content/plugins/bbpress/includes/replies/template.php(35): bbPress->__get()\n#1 /var/www/vhosts/domainname.org/httpdocs/wp-content/plugins/bbpress/includes/common/template.php(461): bbp_get_reply_post_type()\n#2 /var/www/vhosts/domainname.org/httpdocs/wp-content/plugins/bbpress/includes/replies/template.php(544): bbp_is_reply()\n#3 /var/www/vhosts/domainname.org/httpdocs/wp-includes/class-wp-hook.php(324): bbp_get_reply_title_fallback()\n#4 /var/www/vhosts/domainname.org/httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters()\n#5 /var/www/vhosts/domainname.org/httpdocs/wp-includes/post-template.php(174): apply_filters()\n#6 /var/www/vhosts/domainname.org/httpdocs/wp-content/plugins/bbpress/includes/topics/template.php(603)…’, referer: https://www.domainname.org/wp-admin/edit.php?post_type=reply

    Anyone from BBPress help me with this?

    #246738
    Robin W
    Moderator

    without further digging, the function

    echo get_the_post_thumbnail

    seems to support

    thumbnail
    medium
    large
    full

    so you can have for instance

    echo get_the_post_thumbnail($post->ID,'medium',array('class' => 'alignleft forum-icon'));
    echo get_the_post_thumbnail($post->ID,'large',array('class' => 'alignleft forum-icon'));

    you can also play with these settings – see

    https://www.elegantthemes.com/blog/tips-tricks/how-to-change-thumbnail-size-in-wordpress-and-why-you-want-to

    #246737
    andrew55
    Participant

    Sure, this is the code I’m using:

    add_post_type_support('topic', array('thumbnail'));
    add_post_type_support('forum', array('thumbnail'));
    /*
    Plugin Name: bbPress - Forum Icons
    Plugin URI: https://gist.github.com/ntwb/8277457
    Description: bbPress - bbPress - Forum Icons
    Version: 0.1
    Author: Stephen Edgar - Netweb
    Author URI: http://netweb.com.au
    */
    // Original Source: http://www.kristarella.com/2013/04/bbpress-forum-icons/
    add_post_type_support('forum', array('thumbnail'));
    function ks_forum_icons() {
    	if ( 'topic' == get_post_type() ) {
    		global $post;
    	    if ( has_post_thumbnail($post->ID) )
    	    	echo get_the_post_thumbnail($post->ID,'thumbnail',array('class' => 'alignleft forum-icon'));
    	 }
    }
    add_action('bbp_theme_before_topic_title','ks_forum_icons');
Viewing 25 results - 1 through 25 (of 32,499 total)
Skip to toolbar