Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 26 through 50 (of 32,315 total)
  • Author
    Search Results
  • #242000
    Stephen B
    Participant

    You can see an example page now here:
    http://bit.ly/4eG3RLY
    The shortcode also uses the page title (where the shortcode is pasted) instead of the topic title.
    Is it because of incompatibility with the theme?

    #241984
    Stephen B
    Participant

    Thanks for replying and yes, I am using the topic ID and it’s showing the correct topic.
    The issue is that the shortcode is displaying the forum sidebar in addition to the topic.
    You can see here a screenshot of the source code https://ibb.co/2PS9qW1

    #241977
    Robin W
    Moderator

    ok, not totally sure I understand.

    so you are putting the actual topic_id in ?

    eg

    [bbp-single-topic id=265]

    and not sure I understand what ‘it pulls the bbpress forum sidebar widget ‘ means – do you have a link to a live example?

    #241965
    Stephen B
    Participant

    I want to show a single topic on my homepage, on top of the page.
    When I use the shortcode [bbp-single-topic id=$topic_id] it pulls the bbpress forum sidebar widget as well. I am not sure if it’s incompatibility with the theme or normal behavior.

    Is there PHP code I could use instead to pull a single topic? Maybe I could then use that to create a custom template for the homepage.

    Thanks in advance

    #241955
    Robin W
    Moderator

    ok, so that error tells you it is a problem with the plugin gd-topic-polls

    'call to undefined method xxxx in ...public_html/wp-content/plugins/gd-topic-polls'

    That plugin is not written by bbpress and

    GD Topic Polls: plugin for WordPress and bbPress Forums

    says that the free version it is no longer being maintained.

    There is a paid version at

    https://www.dev4press.com/plugins/gd-topic-polls/

    and if you have bought that version, then you need to raise a support ticket with them.

    If you have the free version, then if you want to continue to use this plugin, you would need to buy the paid version

    #241874
    Pierre-Yves
    Participant

    Hi there,

    Test site latest updates and twenty four theme.

    As explain in title I can’t display forum with 2024 and other blocks themes.

    It’s ok to display forum list with shortcode but not forums.

    Thanks four your help.

    #241840
    shaynald
    Participant

    Hi Robin, thank you for replying quickly. Is there a shortcode (or even a php snippet) for adding a forum’s subscribe button to a template?

    #241737
    bobjgarrett
    Participant

    I am struggling with Search for my forum. The standard WP Search within my site works and includes results from the bbpress forums but only shows individual posts. I’d rather show links to the Topic, or at least have a link in the posts found to the topic.
    So I tried to implement Search within the forum.
    I tried using shortcode [bbp-search] but this changes nothing on the page. I tried the shortcode [bbp-search-form] on the page and got a search box but no matter what text I enter in there I only ever get the same single result which is the latest overall WP post, not a bbpress post.
    I have set “Allow forum wide search” in settings.
    What am I doing wrong?

    #241708

    In reply to: Sidebar not showing

    Robin W
    Moderator

    ok, so which method atre you using in

    https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum/ item 3

    if method 1, then try using method 2

    #241609
    alembiq
    Participant

    We had a PHPBB many years ago, which we migrated to bbPress around four years ago, but it seems some flags remained in the database for the whole time, flags like (_bbp_class, _bbp_old_user_id, _bbp_password, _bbp_phpbb_user_avatar, _bbp_phpbb_user_sig). They might be needed; I have no idea.

    But after the last update of WP and all the plugins, all the migrated users started to get an error message instead of being able to log in:
    `
    {“success”:false,”data”:[{“code”:”bbp_converter_db_connection_failed”,”message”:”Database connection failed”}]}
    `
    After some debugging and searching, I found https://bbpress.trac.wordpress.org/ticket/3419#no0 and tried to remove _bbp_class, which helped 🙂

    I just needed to wipe the SQLite Object Cache because it kept the old data. It might happen to someone else in the future, I don’t know. I don’t know if you can somehow influence that this metadata is not stored there or something else. But at least you have the information that it might happen.

    #241607
    kimis
    Participant

    sorry I did
    add_action('bbp_new_forum_form', 'add_formation_field_to_forum_form');

    #241606
    kimis
    Participant

    Well it still doesn’t work, what if instead of that, I add a select on the form to create a forum, I create it also in the admin panel. how can I do that because I did

    add_action('bbp_new_forum_form_after_content', 'add_formation_field_to_forum_form');
    function add_formation_field_to_forum_form() {
        $formations = get_terms(array(
            'taxonomy'   => 'formation',
            'hide_empty' => false,
        ));
        
        if (!empty($formations) && !is_wp_error($formations)) {
            echo '<div class="bbp-form">
                    <label for="forum-formation">Sélectionner une formation :</label>
                    <select name="forum_formation" id="forum-formation">';
            
            foreach ($formations as $formation) {
                echo '<option value="' . esc_attr($formation->term_id) . '">' . esc_html($formation->name) . '</option>';
            }
            
            echo '</select>
                  </div>';
        }
    }

    I want to link the forum to the taxonomy formation I think it should be more easier but in that way it doesn’t work I have linked formation to forum by doing

    function link_formation_taxonomy_to_forums() {
        register_taxonomy_for_object_type('formation', 'forum');
    }
    add_action('init', 'link_formation_taxonomy_to_forums');
    #241597
    Robin W
    Moderator

    ok so from the admin area I think you need to hook to

    do_action( 'bbp_forum_attributes_metabox_save', $forum_id );

    #241593
    kimis
    Participant

    I did

    add_action('bbp_new_forum_post_extras', 'my_custom_bbp_new_forum_handler');
    
    function my_custom_bbp_new_forum_handler( $action = '' ) {
    error_log('test function');
        if ( 'bbp-new-forum' !== $action ) {
            return;
        }
    
        if ( ! bbp_verify_nonce_request( 'bbp-new-forum' ) ) {
            bbp_add_error( 'bbp_new_forum_nonce', __( '<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress' ) );
            return;
        }
    
        do_action( 'bbp_new_forum_post_extras', $forum_id );
    
        $forum_title = get_the_title($forum_id);
        $forum_slug = sanitize_title($forum_title);
    
        if (!term_exists($forum_title, 'forums')) {
            $result = wp_insert_term($forum_title, 'forums', array(
                'name' => $forum_title,
                'slug' => $forum_slug
            ));
    
            if (is_wp_error($result)) {
                error_log("Erreur lors de l'insertion du terme : " . $result->get_error_message());
            } else {
                error_log("Terme de taxonomie 'forums' créé avec succès : " . print_r($result, true));
            }
        } else {
            error_log("Le terme existe déjà : " . $forum_title);
        }
    
        $redirect_url = bbp_get_forum_permalink( $forum_id );
        bbp_redirect( $redirect_url );
    }

    but it still doesn’t work the first error log doesn’t appear on the debug file

    #241592
    Robin W
    Moderator

    I think you need to hook to

    do_action( 'bbp_new_forum_post_extras', $forum_id );

    which is in the function bbp_new_forum_handler

    #241589
    kimis
    Participant

    Hello, I have a taxonomy forums that is is linked to the user, how can I do to create a forum on bbpress and when it’s done it also create a forum on my taxonomy

    my code is :

    function create_forum_taxonomy_entry($forum_id, $forum_args) {

    $forum_title = get_the_title($forum_id);
    $forum_slug = sanitize_title($forum_title);

    error_log(“Création du forum : ” . $forum_title);
    error_log(“Slug du forum : ” . $forum_slug);

    // Insertion du forum dans la taxonomie forum
    if (!term_exists($forum_title, ‘forums’)) {
    $result = wp_insert_term($forum_title, ‘forums’, array(
    ‘slug’ => $forum_slug
    ));

    if (is_wp_error($result)) {
    error_log(“Erreur lors de l’insertion du terme : ” . $result->get_error_message());
    } else {
    error_log(“Term créé avec succès : ” . print_r($result, true));
    }
    } else {
    error_log(“Le terme existe déjà : ” . $forum_title);
    }
    }
    add_action(‘bbp_insert_forum’, ‘create_forum_taxonomy_entry’, 10, 2); but this function isn’t called

    the file has another function below and it works so it’s not the calling of the file

    #241552

    In reply to: PHP Deprecated

    Milan Petrovic
    Participant

    This is not bbPress related. This is error in Avada theme, most likely due to outdated code that is not updated for PHP 8.x. This message is related to changes in PHP 8.1. You need to update Avada, or contact Avada author to fix the problem.

    #241509
    Marisa
    Participant

    Is there an action I can use to execute PHP code before every bbPress page loads?

    Then maybe I can try altering cookies to make bbPress switch languages.

    I want language selection to be dynamic and user controlled.

    #241487
    smelendez
    Participant

    Hello, George.

    First of all, thanks for sharing that code modifications, it seems to fix the pagination for forums set up inside BuddyPress groups without any problem.

    While following your instructions, I have a problem with the pagination between replies and I would like to ask you. For testing purposes, I have set a maximum of 2 replies per page for each topic. When I create a first reply, it is displayed without problem as topic content, but when I create a second reply, it is not displayed and a new page is not created for pagination. However, when I create a third reply, a new page is created showing the second reply and the third reply.

    I think the problem could be with the initial content that is indicated when creating a topic. As you know, when you create a new topic you are asked for a title for that topic as well as some content as an introduction. When you enter the topic, this ‘introduction’ is displayed in the replies section but is not counted as a reply. So having set a maximum of 2 replies per page for each topic for testing, the first page shows the ‘introduction’ and replay 1, but when creating replay 2, as the same page is showing the ‘introduction’, this new reply is not shown and a second page is not created either as it detects only 1 replay on the first page.

    How could this be solved? On the other hand, the pagination between topics works very well.

    Thank you very much in advance, best regards.

    #241471
    pavlovscat
    Participant

    If you look on the linked page and see a big white block, the oEmbed on my site isn’t working (when someone makes a post in bbPress, it automatically embeds it as shown on the page, but the link doesn’t work). Everything looks right, but the link doesn’t work. I can’t figure out what I can do to fix it or disable it. I’ve turned to a friend who knows how to code (I don’t) and she said that her bbPress installation has the same issue.

    Here’s a page with an example:

    Kirk Hunter Farewell Sale

    Thanks for your help.

    #241468
    Clivesmith
    Participant

    Hi Robin,
    Thank you for replying.
    I did find something that was said years ago about not putting the topic title into the reply record, not sure why.
    So I create a record in the meta table, which is a custom field in the reply form using the following code and add the topic title as a custom field to the custom message in the Fs Poster plugin I am using to post to social media.

    
    function check_and_populate_top_title_on_edit() {
        global $pagenow;
    
        // Check if we are in the post.php page (edit post/reply screen) and in the admin area.
        if ($pagenow === 'post.php' && is_admin()) {
            // Get the post ID from the URL query string.
            $post_id = isset($_GET['post']) ? intval($_GET['post']) : 0;
    
            // If we have a valid post ID, proceed.
            if ($post_id) {
                $post = get_post($post_id);
    
                // Ensure we're working with a 'reply' post type.
                if ($post && $post->post_type === 'reply') {
    
                    // Check if the post title is empty.
                    if (empty($post->post_title)) {
                        // Get the parent post ID.
                        $parent_post_id = $post->post_parent;
    
                        // Check if a parent post exists.
                        if ($parent_post_id) {
                            // Get the parent post data.
                            $parent_post = get_post($parent_post_id);
    
                            // If the parent post exists and has a title, update the 'top_title' custom field.
                            if ($parent_post && !empty($parent_post->post_title)) {
                                // Add or update the 'top_title' meta field with the parent post's title.
                                update_post_meta($post_id, 'top_title', $parent_post->post_title);
                            }
                        }
                    }
                }
            }
        }
    }
    
    add_action('load-post.php', 'check_and_populate_top_title_on_edit');
    #241467
    Robin W
    Moderator

    sorry, been working on another project.

    If you fill in the title in the admin of a reply, as far as I know it will cause no issues, I’ve not seen any code that uses this field. I cannot be absolute, but best I can say.

    #241415
    Robin W
    Moderator

    basic economics –

    You using bbpress generates no income for anyone.

    bbpress is a wordpress product, so someone has to sponsor a coder to code stuff, ie someone has to pay for this, and unless there is a reason for this, it doesn’t happen.

    #241399
    uksentinel
    Participant

    Take a look at the below link as this works for a logged in user. The three shortcodes should help achieve what you are looking for.

    bbp topic count

    #241396
    George
    Participant

    I don’t have BuddyBoss installed. bbPress provides integration code that injects the “Forum” tab inside the group creation process. Normally:

    add_filter( 'groups_create_group_steps', function ( $steps ) {
        unset( $steps['forum'] );
        return $steps;
    } );

    or something of that sort would have solved the issue. I was wondering of bbPress injects the tab in a different way.

    I would appreciate if you could forward that to one of the devs, since you are a Mod, Robin, otherwise, thanks for the help.

Viewing 25 results - 26 through 50 (of 32,315 total)
Skip to toolbar