Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'bbpress'

Viewing 25 results - 4,601 through 4,625 (of 64,471 total)
  • Author
    Search Results
  • #211289
    Robin W
    Moderator

    you can only enqueue a style name once, so suggest you rename the second child one eg

    wp_enqueue_style( 'child-theme-css', get_stylesheet_directory_uri() .'/style.css' , array('parent-style'));
      wp_enqueue_style( 'child-theme-bbpress-css', get_stylesheet_directory_uri() .'/css/bbpress.css', array());

    that might be the problem, if not, it certainly isn’t helping

    #211278
    Robin W
    Moderator

    the bbpress theme that this site uses is here

    https://meta.trac.wordpress.org/browser/sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base

    the following file holds the code

    https://meta.trac.wordpress.org/browser/sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base/header-subnav.php

    but you will also need to pull through some css from the theme, and JavaScript to do the drop downs

    then tie all this back to the right place in your theme.

    It’s quite doable, but well beyond free help

    #211274
    #211269
    failxontour
    Participant

    Hey so I’m trying to enqueue custom CSS for bbPress v2.6.4 on the WP 5.4.1 clan website running a WP Twenty Twenty-child theme.

    This is what my functions.php currently looks like

    <?php
    /**
    * Child theme stylesheet einbinden in Abhängigkeit vom Original-Stylesheet
    */
    add_action( 'wp_enqueue_scripts', 'child_theme_styles' );
    function child_theme_styles() {
      wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
      wp_enqueue_style( 'child-theme-css', get_stylesheet_directory_uri() .'/style.css' , array('parent-style'));
      wp_enqueue_style( 'child-theme-css', get_stylesheet_directory_uri() .'/css/bbpress.css', array());
    }
    ?>
    

    And this is how my bbpress.css looks like.

    
    #bbp-forum-info,
    #bbp-forum-topic-count,
    #bbp-forum-reply-count,
    #bbp-forum-freshness {
      color: #232323;
    }
    #bbpress-forums {
      background: transparent;
      clear: both;
      margin-bottom: 20px;
      overflow: hidden;
      font-size: 1.75rem;
      color: #232323;
    }
    

    The changes I applied in the bbpress.css won’t update the bbpress CSS on the above mentioned site. So their must be something wrong with my functions.php but I can’t yet put my finger on it how to load it properly as I’m pretty new when it comes to WordPress. I wanna append these changes globally to all parts of bbPress forum.

    Can someone tell me to if and what i need to specify inside the arrray() call for the bbpress.css to load properly? Or hint me towards what’s wrong here.

    Robin W
    Moderator

    meta boxes are used in the backend, but you are most of the way there.

    so to add the dropdown you can use

    add_action(‘bbp_theme_before_reply_content’, ‘so_additional_content’);

    (there is a bbp_theme_after_reply_content action as well)

    and then in the function put the drop down stuff – I’ve not checked your code, so you’ll need to tidy and correct the following if it doesn’t work

    so

    function so_additional_content () {
    ?>
    <label>Choose the size of the element : </label>
    <select name=”custom_element_grid_class” id=”custom_element_grid_class”>
    <option value=”normal” <?php selected( $meta_element_class, ‘normal’ ); ?>>normal</option>
    <option value=”square” <?php selected( $meta_element_class, ‘square’ ); ?>>square</option>
    <option value=”wide” <?php selected( $meta_element_class, ‘wide’ ); ?>>wide</option>
    <option value=”tall” <?php selected( $meta_element_class, ‘tall’ ); ?>>tall</option>
    </select>
    <?php 
    }

    Then when the user presses submit a function in bbpress called ‘new reply handler’ takes over.

    that has a hook

    do_action( ‘bbp_new_reply_post_extras’, $reply_id );

    which you can link to, to do the save.

    so you would have

    add_action ( 'bbp_new_reply_post_extras' , 'so_save' ) ;
    
    function so-save ($reply_id) {
    $meta_element_class = $_POST[‘custom_element_grid_class’];
    update_post_meta($reply_id, ‘custom_element_grid_class_meta_box’, $meta_element_class);
    }

    again your code is not checked.

    you will need to add functionality if you want users to edit their replies and change the dropdown selection

    I’ll let you play with the above, and do come back with a first version if you need extra help.

    If you fix it, then PLEASE post your solution here to help others

    g28f99
    Participant

    I hope to customize bbpress reply form area with dropdown selection list. I could not find any previous post reporting similar case in bbpress. Referring to post “Save meta box data from selected dropdown list” with link I prepared similar code for the bbpress reply post condition, but failed to achieve the goal.
    Please kindly provide suggestions!

    ` add_action( ‘bbp_theme_before_reply_form_content’, ‘so_custom_meta_box’ );
    //add_action( ‘add_meta_boxes’, ‘so_custom_meta_box’ );

    function so_custom_meta_box($post){
    add_meta_box(‘so_meta_box’, ‘Custom Box’, ‘custom_element_grid_class_meta_box’, $post->post_type, ‘normal’ , ‘high’);
    }

    add_action(‘bbp_theme_before_reply_content’, ‘so_save_metabox’);

    function so_save_metabox(){
    global $post;
    if(isset($_POST[“custom_element_grid_class”])){
    //UPDATE:
    $meta_element_class = $_POST[‘custom_element_grid_class’];
    //END OF UPDATE

    update_post_meta($reply_id, ‘custom_element_grid_class_meta_box’, $meta_element_class);
    //print_r($_POST);
    }
    }
    function custom_element_grid_class_meta_box($post){
    $reply_id = bbp_get_reply_id();
    $meta_element_class = get_post_meta($reply_id, ‘custom_element_grid_class_meta_box’, true); //true ensures you get just one value instead of an array
    ?>
    <label>Choose the size of the element : </label>

    <select name=”custom_element_grid_class” id=”custom_element_grid_class”>
    <option value=”normal” <?php selected( $meta_element_class, ‘normal’ ); ?>>normal</option>
    <option value=”square” <?php selected( $meta_element_class, ‘square’ ); ?>>square</option>
    <option value=”wide” <?php selected( $meta_element_class, ‘wide’ ); ?>>wide</option>
    <option value=”tall” <?php selected( $meta_element_class, ‘tall’ ); ?>>tall</option>
    </select>
    <?php
    }

    #211259
    supportowpok
    Participant

    I have “AsynCRONous bbPress Subscriptions”

    #211253
    thomasprice61
    Participant

    Hi Robin,
    Definitely something weird going on with roles & capabilities.
    Ended up:
    1. removing all forum entries
    2. delete bbPress plugin folder

    Not the best way to remove a plugin, but all seems OK

    thank you

    #211251
    zackxoxo
    Participant

    I’ve recently tried the bbpress plugin and have had 0 luck figuring out how to install any themes. Does anyone out there know of a good tutorial explaining how to do this?

    I really want to use bbpress but it just looks horrible with my theme from Elegant Themes. (And the theme looks great).

    Thanks!

    #211249
    Robin W
    Moderator

    given that you don’t have bbpress running (ie you’ve deleted the folder), then nothing will use those roles and capabilities, so I suspect there is no harm in just leaving them.

    The alternate is to create another vanilla worpress site, and that will then have all the worpdress roles in the wp-options entry.

    You can then use phpmyadmin to copy the existing entry from the problem site to a txt file (so you have it saved), and then copy the new site entry into it’s place.

    Then that entry will have all it should.

    #211248
    cmsplay
    Participant

    Loving bbPress.

    We’ve set our fora (forums) to show only for logged-in users.

    When a visitor is not logged in and they click on the Fora link, bbPress shows the following message:

    Oh, bother! No forums were found here.

    We’d rather that the message said ‘Fora are viewable by logged in members’.

    How and where do we edit the ‘Oh bother!’ message? (Which might be the right CSS file?)

    Thank you.

    cmsplay
    Participant

    Have you set your bbPress fora to be viewable only by logged-in users? If so, non-logged-in users would be directed to the ‘Oh bother!’ message.

    #211243
    Robin W
    Moderator

    no, I think that is probably the core of the problem.

    basically capabilities are stored against each role in the database in the wp_options table in the database under name wp_user_roles.

    Each role is stated, and then it’s capabilities are stored against it.

    bbpress is trying to remove roles/capabilities from each bbpress role, and is failing.

    maybe if you look in the database and see what bbpress roles you have – if none, then there is nothing for bbpress to do, and that may be why it is erroring

    #211242
    thomasprice61
    Participant

    Hi Robin,
    Deleted the bbPress folder.
    Plugin screen came up fine and stated bbPress was gone.
    Reinstalled bbPress
    Same issue.

    It looks like it fails when attempting to remove ‘spectate’

    See log above: WP_Role->remove_cap(‘spectate’)

    I was surprised as an Administrator, all the bbPress roles were read-only.
    Is that normal?
    As an Admin are your bbPress roles read-only?

    #211238
    Robin W
    Moderator

    what other bbpress related plugins are you running?

    #211236
    Robin W
    Moderator

    sorry, I’m just a bbpress user who helps out here, in 5 years, I’ve not seen this issue.

    I’d suggest that you just delete the plugin using FTP.

    #211232
    thomasprice61
    Participant

    Changed theme to twentytwenty
    Deactivated all plugins apart from bbpress
    Then tried to deactivate bbPress last … same error.

    Note, the Membership plugin was uninstalled earlier.

    #211231
    Robin W
    Moderator

    ok, it is a site specific issue, and might (or might not) be related to the members plugin -I have no idea how that plugin works or how you view roles using it.

    so all I can say is it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentytwenty, and see if this fixes.

    Plugins

    If that doesn’t work, also deactivate all plugins apart from bbpress and see if this fixes. if it does, re-enable one at a time to see which is causing the error.

    Then come back

    #211230
    thomasprice61
    Participant

    I used the Members plugin to check the roles.
    All the bbPress roles are read-only.
    (As administration I was unable to edit them)
    Is that correct?

    #211225

    In reply to: Adding roles

    Robin W
    Moderator

    https://codex.bbpress.org/custom-capabilities/ is a better way, as updates to bbpress don’t overwrite, but as long as you know that bbpress updates will need you to go back into those files.

    #211223
    thomasprice61
    Participant

    Here is the debug log:

    [21-May-2020 04:26:20 UTC] PHP Fatal error: Uncaught Error: Cannot unset string offsets in /hsphere/local/home/somewhere/somewhere/wp-includes/class-wp-role.php:75
    Stack trace:
    #0 /hsphere/local/home/somewhere/somewhere/wp-content/plugins/bbpress/includes/core/capabilities.php(240): WP_Role->remove_cap(‘spectate’)
    #1 /hsphere/local/home/somewhere/somewhere/wp-includes/class-wp-hook.php(287): bbp_remove_caps(”)
    #2 /hsphere/local/home/somewhere/somewhere/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #3 /hsphere/local/home/somewhere/somewhere/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #4 /hsphere/local/home/somewhere/somewhere/wp-content/plugins/bbpress/includes/core/sub-actions.php(40): do_action(‘bbp_deactivatio…’)
    #5 /hsphere/local/home/somewhere/somewhere/wp-includes/class-wp-hook.php(287): bbp_deactivation(false)
    #6 /hsphere/local/home/somewhere/somewhere/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #7 /hsphere/local/home/somewhere/somewhere/wp-include in /hsphere/local/home/somewhere/somewhere/wp-includes/class-wp-role.php on line 75

    #211222
    thomasprice61
    Participant

    I also followed this: https://codex.bbpress.org/getting-started/installing-bbpress/deleting-bbpress/
    and get the same fatal error:

    Fatal error: Uncaught Error: Cannot unset string offsets
    in /hsphere/local/home/audax/dev1.audax.org.au/wp-includes/class-wp-role.php on line 75

    Call stack:

    WP_Role::remove_cap()
    wp-content/plugins/bbpress/includes/core/capabilities.php:240
    bbp_remove_caps()
    wp-content/plugins/bbpress/includes/admin/tools/reset.php:262
    bbp_admin_reset_database()
    wp-content/plugins/bbpress/includes/admin/tools/reset.php:100
    bbp_admin_reset_handler()
    wp-includes/class-wp-hook.php:287
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:311
    WP_Hook::do_action()
    wp-includes/plugin.php:478
    do_action()
    wp-admin/admin.php:232
    require_once()
    wp-admin/tools.php:40

    #211221
    thomasprice61
    Participant

    bbPress Version 2.6.4

    It is a vanilla install, no customisation or plugins.
    I tried to deactivate bbPress and get the following error:

    Fatal error: Uncaught Error: Cannot unset string offsets
    in /hsphere/local/home/somewhere/something/wp-includes/class-wp-role.php on line 75

    Call stack:

    WP_Role::remove_cap()
    wp-content/plugins/bbpress/includes/core/capabilities.php:240
    bbp_remove_caps()
    wp-includes/class-wp-hook.php:287
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:311
    WP_Hook::do_action()
    wp-includes/plugin.php:478
    do_action()
    wp-content/plugins/bbpress/includes/core/sub-actions.php:40
    bbp_deactivation()
    wp-includes/class-wp-hook.php:287
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:311
    WP_Hook::do_action()
    wp-includes/plugin.php:478
    do_action()
    wp-admin/includes/plugin.php:812
    deactivate_plugins()
    wp-admin/plugins.php:194

    Can you please assist?

    #211220

    In reply to: Adding roles

    zirow
    Participant

    I’ve added this reply like 3times and everytime i edit it it disappeared and when i try to re-paste it and submit i cant cuz i get a warning for duplication 😛

    I’m pretty sure theirs a better way of doing it but that’s how I did since its the only way I could figure it out

    Open Capabilities.php

    Under “function bbp_get_caps_for_role”
    Add this case along with the other cases

    case bbp_get_tutor_role() :
    $caps = array(

    // Primary caps
    ‘spectate’ => true,
    ‘participate’ => true,

    // Forum caps
    ‘read_private_forums’ => true,

    // Topic caps
    ‘publish_topics’ => true,
    ‘edit_topics’ => true,

    // Reply caps
    ‘publish_replies’ => true,
    ‘edit_replies’ => true,

    // Topic tag caps
    ‘assign_topic_tags’ => true,
    );

    Under:

    function bbp_get_participant_role() {

    // Filter & return
    return apply_filters( ‘bbp_get_participant_role’, ‘bbp_participant’ );
    }

    Add:

    function bbp_get_tutor_role() {

    // Filter & return
    return apply_filters( ‘bbp_get_tutor_role’, ‘bbp_tutor’ );
    }

    Save and close Capabilities.php and open bbpress.php in the plugin directory not the one inside the theme.

    Search for:
    public function roles_init() {

    You will see this code:

    $keymaster = bbp_get_keymaster_role();
    $moderator = bbp_get_moderator_role();
    $participant = bbp_get_participant_role();
    $spectator = bbp_get_spectator_role();
    $blocked = bbp_get_blocked_role();

    // Build the roles into one useful array
    $this->roles[ $keymaster ] = new WP_Role( ‘Keymaster’, bbp_get_caps_for_role( $keymaster ) );

    $this->roles[ $moderator ] = new WP_Role( ‘Moderator’, bbp_get_caps_for_role( $moderator ) );
    $this->roles[ $participant ] = new WP_Role( ‘Participant’, bbp_get_caps_for_role( $participant ) );
    $this->roles[ $spectator ] = new WP_Role( ‘Spectator’, bbp_get_caps_for_role( $spectator ) );
    $this->roles[ $blocked ] = new WP_Role( ‘Blocked’, bbp_get_caps_for_role( $blocked ) );
    }

    So you just want to add these two codes in their:

    $tutor = bbp_get_tutor_role();

    $this->roles[ $tutor ] = new WP_Role( ‘tutor’, bbp_get_caps_for_role( $tutor ) );

    If u want to rename an existing role u added or bbpress default roles u can add this into your functions.php

    Add:

    function ntwb_bbpress_custom_role_names() {

    return array(

    // Keymaster

    bbp_get_keymaster_role() => array(

    ‘name’ => ‘Administrator’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_keymaster_role() )

    ),

    // Moderator

    bbp_get_moderator_role() => array(

    ‘name’ => ‘Moderator’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_moderator_role() )

    ),

    // Participant

    bbp_get_participant_role() => array(

    ‘name’ => ‘Member’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() )

    ),

    bbp_get_tutor_role() => array(

    ‘name’ => ‘Member2’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_tutor_role() )

    ),

    // Spectator

    bbp_get_spectator_role() => array(

    ‘name’ => ‘Spectator’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_spectator_role() )

    ),

    // Blocked

    bbp_get_blocked_role() => array(

    ‘name’ => ‘Blocked’,

    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_blocked_role() )

    )

    );

    }

    redevelop
    Participant

    Just to add – bbPress version 2.6.4.

Viewing 25 results - 4,601 through 4,625 (of 64,471 total)
Skip to toolbar