Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 226 through 250 (of 32,294 total)
  • Author
    Search Results
  • #239256
    enkoes
    Participant

    Thanks again. Can you look into the second issue as well?

    The bullet point (*) is wrongly used in title “Forum” & “Posts”. I just feel that title should not apply bullet point.

    Regards.

    #239243
    enkoes
    Participant

    I deleted all other widgets, and started with this Forum List widget first, followed by others. Overlapping issue persists. One thing to note is that all other widgets have not caused this problem, including those from Bbp Style Pack. This make me think that the issue is not from the theme itself (probably something missing within the codes?)

    #239233
    enkoes
    Participant

    Thanks for your effort @robin-w.

    I want to highlight two issues with this widget:

    1) If I position it as the first widget in the sidebar, it overlaps with other widgets which supposed to move down and give way to this widget;

    2) The bullet point (*) is wrongly used in title “Forum” & “Posts”. I just feel that title should not apply bullet point.

    * Forum                  * Posts
    * Development & Updates   * 93
    * Installation            * 28,139
    * Troubleshooting         * 61,540
    * Themes                  * 10,285
    * Plugins                 * 15,193
    * Requests & Feedback     * 14,798
    * Showcase                * 3,252

    Other than these two, the widget looks great! 🙂

    #239231
    anutgc
    Participant

    On this page – https://thebakersjunction.com/forums/
    the footer code comes up as text.

    I disabled all plugins one by one. When i disabled G5 Core plugin the problem on this page disappeared but my entire site template got broken.

    I guess it is a conflict between bbpress and g5 core.

    Pls help

    #239212
    Robin W
    Moderator

    ok, that is not the correct place to put it. Can you remove it from there.

    I see you have bbp style pack active, so can you put the code in

    dashboard>settings>bbp syle pack>custom css

    #239209
    patcg
    Participant

    @robin-w i added the above code in my style.css file by accessing
    Dashboard > Tools > Theme File Editor > style.css

    But it hasn’t worked for me.

    #239204
    Robin W
    Moderator

    try adding this to your theme’s additional css

    .bbpress .wp-block-group-is-layout-flex {
    	width: 100%;
    	max-width: 100%;
    	padding-left: 200px;
    }
    Robin W
    Moderator

    probably (untested)

    add_action ('plugins_loaded' , 'rew_move_reply_button' ) ;
    
    function rew_move_reply_button () {
    	remove_action ( 'bbp_template_before_single_topic', 'bsp_display_reply_button' );
    	add_action ( 'bbp_theme_after_topic_content', 'bsp_display_reply_button' );
    }

    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

    #239189
    enkoes
    Participant

    Hi, sorry for the confusion. I don’t know why I can’t post a screenshot link in this forum. Never mind, I just typed it out. Below is the widget I mean:

    Forum                   Posts
    Development & Updates   93
    Installation            28,139
    Troubleshooting         61,540
    Themes                  10,285
    Plugins                 15,193
    Requests & Feedback     14,798
    Showcase                3,252

    Regards.

    #239143
    kyle_conrad
    Participant

    Pulling my hair out on this one – Forums and Topics work just fine in the admin and in the front-end. However, Replies totally crash the site – on the front-end, they just fail quietly, but Add New on the Replies page in admin causes WordPress to fail. Trying to track down what could possibly cause this, because it feels really strange!

    Copying over the first 100 lines or so of the stack trace to see if ANYONE has any idea what could be causing this.

    Error:
    Xdebug has detected a possible infinite loop, and aborted your script with a stack depth of '1024' frames
    
      at /www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-object-cache.php:141
      at WP_Object_Cache->is_valid_key()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-object-cache.php:364)
      at WP_Object_Cache->get()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/cache.php:154)
      at wp_cache_get()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-post.php:240)
      at WP_Post::get_instance()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/post.php:1036)
      at get_post()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/post.php:1495)
      at get_post_type()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/common/template.php:454)
      at bbp_is_reply()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:544)
      at bbp_get_reply_title_fallback()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-hook.php:324)
      at WP_Hook->apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/plugin.php:205)
      at apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/post-template.php:174)
      at get_the_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/topics/template.php:603)
      at bbp_get_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:1405)
      at bbp_get_reply_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:549)
      at bbp_get_reply_title_fallback()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-hook.php:324)
      at WP_Hook->apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/plugin.php:205)
      at apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/post-template.php:174)
      at get_the_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/topics/template.php:603)
      at bbp_get_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:1405)
      at bbp_get_reply_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:549)
      at bbp_get_reply_title_fallback()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-hook.php:324)
      at WP_Hook->apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/plugin.php:205)
      at apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/post-template.php:174)
      at get_the_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/topics/template.php:603)
      at bbp_get_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:1405)
      at bbp_get_reply_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:549)
      at bbp_get_reply_title_fallback()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-hook.php:324)
      at WP_Hook->apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/plugin.php:205)
      at apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/post-template.php:174)
      at get_the_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/topics/template.php:603)
      at bbp_get_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:1405)
      at bbp_get_reply_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:549)
      at bbp_get_reply_title_fallback()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-hook.php:324)
      at WP_Hook->apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/plugin.php:205)
      at apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/post-template.php:174)
      at get_the_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/topics/template.php:603)
      at bbp_get_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:1405)
      at bbp_get_reply_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:549)
      at bbp_get_reply_title_fallback()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-hook.php:324)
      at WP_Hook->apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/plugin.php:205)
      at apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/post-template.php:174)
      at get_the_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/topics/template.php:603)
      at bbp_get_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:1405)
      at bbp_get_reply_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:549)
      at bbp_get_reply_title_fallback()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/class-wp-hook.php:324)
      at WP_Hook->apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/plugin.php:205)
      at apply_filters()
         (/www/kinsta/public/internationalmidwivesorg/wp-includes/post-template.php:174)
      at get_the_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/topics/template.php:603)
      at bbp_get_topic_title()
         (/www/kinsta/public/internationalmidwivesorg/wp-content/plugins/bbpress/includes/replies/template.php:1405)
    #239032

    In reply to: Add required fields

    Robin W
    Moderator

    they are saved in the database post_meta table against the thread

    update_post_meta( $topic_id, 'bbp_extra_field1', $_POST['bbp_extra_field1'] );

    and you would need to define what you mean by

    I don’t know how to move the various fields

    #239029
    kioubizin
    Participant

    Hello,

    While trying to access users from admin menu, I am getting a fatal error and when enabling the debug mode, I am getting this error message:

    Fatal error: Uncaught Error: Call to undefined function bp_core_get_user_domain() in /home/islandbnb/public_html/wp-content/plugins/bbpress/includes/extend/buddypress/members.php:229 Stack trace: #0 /home/islandbnb/public_html/wp-content/plugins/bbpress/includes/extend/buddypress/members.php(100): BBP_BuddyPress_Members->get_profile_url(2) #1 /home/islandbnb/public_html/wp-includes/class-wp-hook.php(324): BBP_BuddyPress_Members->get_user_profile_url(2) #2 /home/islandbnb/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(2, Array) #3 /home/islandbnb/public_html/wp-content/plugins/bbpress/includes/core/abstraction.php(471): apply_filters('bbp_pre_get_use...', 2) #4 /home/islandbnb/public_html/wp-content/plugins/bbpress/includes/users/template.php(560): bbp_maybe_intercept('bbp_pre_get_use...', Array) #5 /home/islandbnb/public_html/wp-content/plugins/bbpress/includes/admin/users.php(260): bbp_get_user_profile_url(2) #6 /home/islandbnb/public_html/wp-includes/class-wp-hook.php(324): BBP_Users_Admin->user_row_actions(Array, Object(WP_User)) #7 /home/islandbnb/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #8 /home/islandbnb/public_html/wp-admin/includes/class-wp-users-list-table.php(520): apply_filters('user_row_action...', Array, Object(WP_User)) #9 /home/islandbnb/public_html/wp-admin/includes/class-wp-users-list-table.php(415): WP_Users_List_Table->single_row(Object(WP_User), '', '', 0) #10 /home/islandbnb/public_html/wp-admin/includes/class-wp-list-table.php(1709): WP_Users_List_Table->display_rows() #11 /home/islandbnb/public_html/wp-admin/includes/class-wp-list-table.php(1636): WP_List_Table->display_rows_or_placeholder() #12 /home/islandbnb/public_html/wp-admin/users.php(814): WP_List_Table->display() #13 {main} thrown in /home/islandbnb/public_html/wp-content/plugins/bbpress/includes/extend/buddypress/members.php on line 229

    #239016

    In reply to: Shortcode

    checmark
    Participant

    Thanks. Yes, I found that somewhere after posting here and that works. One thing I’m still struggling with is that the forum is restricted to members. I added a sidebar with the shortcodes for login, register and forgot password, but the member forum still shows. I installed the Paid Membership Pro plugin but then it shows nothing. I’m not sure what is the best way to show the forum. I also installed Popup Maker which shows on the home page and then sends the visitor to the contact page which shows their membership number to join.

    This is a website that I am proposing to the Legion, not one I’m getting paid for, so I’ve spent weeks building it. I do hope that it might be adopted by the National Headquarters to be used as a template by the 1,367 branches in Canada.

    Appreciate your thoughts and your help.

    #239015

    In reply to: Shortcode

    Robin W
    Moderator

    that shortcode shows the full list of forums, not topics.

    if that is your only forum, and you want to display all the topics of that forum, then use

    [bbp-single-forum id=$forum_id]

    #239014

    In reply to: Shortcode

    checmark
    Participant

    Thanks for responding. What shows is just the image I added for the Members Forum, not the full list of topics as the shortcode suggests.

    #239012

    Topic: Shortcode

    in forum Installation
    checmark
    Participant

    I am using the shortcode [bbp-forum-index] but it is not showing any topics, just the image I added to the Members Forum.

    Forum

    Appreciate any help.

    #238999
    alexalalalad321
    Participant

    I installed the plugin, I put the differinte shortcodes in my site and when i access the page I can see the the topic/fourms i made from the dashboard but when i click them its a blank screen

    please help!

    #238986
    stonebkfly
    Participant

    Thank you! The issue turned out to be I was entering the wrong username in the Forum Moderators textbox. I was using the WP Username (user_login field on users table) but when I used the encoded email address it excepted it. Eg. If the email was name@domain.com I needed to use name-domain-com.

    #238985
    stonebkfly
    Participant

    We are implementing bbPress to add private forums to LearnDash courses. We are using the LearnDash bbPress Integration plugin.

    When a logged in user views the /forums page or the /topics page they see all forums and topics. (We are using Visibility: Private for forums) even though the user does not have access to the forums or topics due to the LearnDash Integration plugin. I asked LearnDash if they know a way to hide the ones that the user does not have access to. They said that they did not know, and that I should contact bbPress support.

    Is there a way that I can programmatically add a per user filter for the following shortcodes: [bbp-forum-index], [bbp-topic-index]? I would like to inject logic that would exclude records based on the currently logged in user.

    Any ideas would be appreciated! I may need to write my one shortcode but did not want to reinvent the wheel if I do not need to!

    Thank you!
    Joseph

    #238981
    Robin W
    Moderator

    the backend seems to only save one moderator.

    This code should fix

    add_action ('bbp_subscriptions_metabox' , 'rew_set_hidden_subscribers' ) ;
    add_action ('bbp_topic_attributes_metabox_save' , 'rew_save_subscriptions', 10 , 2) ;
    
    function rew_set_hidden_subscribers ($post) {
    	// Get user IDs
    	$user_ids = bbp_get_subscribers( $post->ID );
    	$list = implode(",",$user_ids); 
    
    	// Output
    	?>
    	<input name="rew_topic_subscription" id="rew_topic_subscription" type="hidden" value="<?php echo $list; ?>" />
    	<?php
    }
    
    function rew_save_subscriptions ( $topic_id, $forum_id ) {
    	// Handle Subscriptions
    	if ( bbp_is_subscriptions_active() && ! empty( $_POST['rew_topic_subscription'] )) {
    		//update_option ($subscriptions)
    		$subscriptions = explode(",", $_POST['rew_topic_subscription']);
    		foreach ($subscriptions as $subscription_id ) {
    			// Check if subscribed and if so do nothing
    			if (bbp_is_user_subscribed( $subscription_id, $topic_id )) continue;
    			else {
    			bbp_add_user_subscription( $subscription_id, $topic_id );
    			}
    		}
    	}
    }

    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

    or if you use

    bbp style pack

    this fix is automatically added

    #238959
    aballagh
    Participant

    Hello.

    I would like a forum index that is separate from the archives page, but haven’t been able to get that working.

    I’ve changed the slug in the settings, created a page with that slug, but it redirects to the posts archives every time.

    If I include the shortcode on the archives page it works fine, but then it’s available to the general public, and I’d like it to be on its own, and available to members only.

    Any help would be appreciated.

    WP and BBP are latest versions. Archives page is here: https://simcoecountygreenbelt.ca/our-work/ and the Forum Index is supposed to be here: https://simcoecountygreenbelt.ca/community/

    #238956
    ibnat
    Participant

    I forgot to mention. On setting up your forum before creating your app there is one plugin that is essential. (Thankyou Robin!) 🙂

    bbp style pack

    Here are all the plugins I am using.

    bbp profile information Version 2.1.2 by Robin Wilson
    bbPress Version 2.6.9 by The bbPress Contributors
    bbP Signature Version 1.4 by Arjun S Kumar, Robin W
    bbp style pack Version 5.7.8 by Robin Wilson
    GD bbPress Attachments Version 4.6 by Milan Petrovic
    Hide Admin Bar Based on User Roles Version 3.7.0 by Ankit Panchal
    Import and export users and customers Version 1.25.1 by codection
    LiteSpeed Cache Version 6.0.0.1 by LiteSpeed Technologies
    Meow Lightbox Version 5.1.1 by Jordy Meow
    reCaptcha by BestWebSoft Version 1.74 by BestWebSoft
    Site Kit by Google Version 1.116.0 by Google
    Smush Version 3.15.3 by WPMU DEV
    Super RSS Reader Version 5.1 by Aakash Chakravarthy
    WP Mail From II Version 2.0 by Ben Huson
    WPMobile.App — Android and iOS Mobile Application Version 11.41 by WPMobile.App
    WP User Avatars Version 1.4.1 by Triple J Software, Inc.
    Yoast SEO Version 21.8 by Team Yoast

    #238950

    Topic: Caption code

    in forum Installation
    ditout
    Participant

    Hi,
    I have installed BBPress for my forum, some photos of my forum have these code:
    [caption id="attachment_1496" align="alignnone" width="300"] [/caption]
    Please tell me how to remove it,
    Thank you very much!

    #238927
    rilliencot
    Participant

    Although I solved the last issue, a similar one immediately came up after that (The topic count at the top of a forum didn’t count new topics). I had a feeling that as long as I proceeded with this hacked version of the actual bbPress functions that I now thankfully know are responsible for topic creation (thank you Robin, again!), these little discrepencies were going to keep popping up.

    So I’ve updated the ‘create_bill’ function to now call bbp_insert_topic() (line 24 of \bbpress\includes\topics\functions.php). If I understand things correctly (I’m new to web development and learning as I go), this starts the natural chain of events that should happen anytime a new topic is created (at least it looks to be working). I still need the new endpoint because I’d like to add some custom fields to these topics as well, so now the above php script is the much simpler:

    <?php
    /**
     * Plugin Name:       bbPress Bill API
     * Description:       Exposing the bbPress post types to WP API and creating a namespace for bills.
     * Author:            Rillien Cot
     * Version:           1.6.0
     */
    
    /**
     * Add REST API support to an already registered post type.
     */
    add_action('init', 'register_bbp_post_types', 25);
    
    function register_bbp_post_types() {
        global $wp_post_types;
    
        $post_type_name =  bbp_get_reply_post_type();
        if (isset($wp_post_types[$post_type_name])) {
            $wp_post_types[$post_type_name]->show_in_rest = true;
            $wp_post_types[$post_type_name]->rest_base = $post_type_name;
            $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
        }
        $post_type_name =  bbp_get_topic_post_type();
        if (isset($wp_post_types[$post_type_name])) {
            $wp_post_types[$post_type_name]->show_in_rest = true;
            $wp_post_types[$post_type_name]->rest_base = $post_type_name;
            $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
        }
        $post_type_name =  bbp_get_forum_post_type();
        if (isset($wp_post_types[$post_type_name])) {
            $wp_post_types[$post_type_name]->show_in_rest = true;
            $wp_post_types[$post_type_name]->rest_base = $post_type_name;
            $wp_post_types[$post_type_name]->rest_controller_class = 'WP_REST_Posts_Controller';
        }
    
        // Add custom REST API endpoint for creating bbPress topic
        add_action('rest_api_init', 'create_bill_endpoint');
    }
    
    function create_bill_endpoint() {
        register_rest_route('pnyx/v2', '/bill/', array(
            'methods' => 'POST',
            'callback' => 'create_bill',
        ));
    }
    
    function create_bill($data) {
        // Extract Data
        $new_topic_data = $data['new_post_data'];
        $new_topic_meta = $data['new_post_meta'];
    
        // Create new bbPress topic using passed data and meta content
        $topic_id = bbp_insert_topic($new_topic_data, $new_topic_meta);
    
        // Add ACF custom fields to created topic
        update_field('bill_id', $data['bill_id'], $topic_id);
    }
    ?>

    and the python that calls it is:

    import requests
    import json
    
    # Set your WordPress API authentication details
    username = "************"
    password = "***********************"
    auth = requests.auth.HTTPBasicAuth(username, password)
    
    # Create a new post data with post_parent
    new_post_payload = {
        "new_post_data": {
            "post_parent": 40, // use a valid forum_id from your site
            "post_title": "API Created Post Title",
            "post_content": "Lorem ipsum content for the new topic",
        },
        "new_post_meta": {
            "forum_id": 40, //use same forum_id here that you used for "post parent" in 'new_post_data'
        },
        "bill_id": "hrs1111",
    }
    
    # Make the POST request to create a new post
    wordpress_api_url = "http://pnyx.local/wp-json/pnyx/v2/bill/"
    response = requests.post(
        wordpress_api_url,
        auth=auth,
        headers={
            'Content-Type': 'application/json',
        },
        data=json.dumps(new_post_payload),
    )

    You’ll notice that the ‘data’ portion of the request has changed from a simple dictionary to nested dictionaries so the bbp_insert_topic function has the correct arguments (it takes two arrays).

    #238920
    Robin W
    Moderator

    when you have completed, in the spirit of open software and helping others, can you post your final solution code please

Viewing 25 results - 226 through 250 (of 32,294 total)
Skip to toolbar