Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 2,426 through 2,450 (of 32,462 total)
  • Author
    Search Results
  • #213840
    Robin W
    Moderator

    and can you look at this

    Step by step guide to setting up a bbPress forum – Part 1

    Items 3 and 8

    Robin W
    Moderator

    loads of plugins still use this, so lots of plugin authors will need to change code 🙂

    phy9pas
    Participant

    I’m running WP 5.5 and BBP 2.6.5

    It seems that WP5.5 has deprcated the method wp_make_content_images_responsive but it is still being hooked in
    /plugins/bbpress/includes/core/filters.php
    lines 194 & 195

    This is causing a warning message to be thrown

    #213798

    In reply to: Indent forums

    Robin W
    Moderator

    I’d try using padding-left instead

    #213793
    p3t3rr
    Participant

    UPDATE:

    I found the issue. 2 weeks back I added the following function to functions.php > child theme, because I wanted to rename the Keymaster to Administrator:

    // change user role name 'Verwalter' to 'Administrator'
    function ntwb_bbpress_custom_role_names() {
    	
    	// Keymaster
            bbp_get_keymaster_role() => array(
                'name'         => 'Administrator',
                'capabilities' => bbp_get_caps_for_role( bbp_get_keymaster_role() )
            )
    }
    add_filter( 'bbp_get_dynamic_roles', 'ntwb_bbpress_custom_role_names' );
    

    It successfully renamed the role and I was done with the issue. However, it apparently removed all the other default bbpress roles. I thought this function is exclusively for renaming roles as the name suggests.

    I went back and included all other default roles into that function in the child theme (The complete rename roles function can be seen eg here.) Now I see all roles in settings > forum > automatically assign roles. Also in user management I see all forum roles. Also, new forum registrants are automatically assigned to subscriber.

    problem solved.

    p3t3rr
    Participant

    not sure why you need the second bit of code?

    I thought it’s necessary to in case subsribers have the link ‘mysite.com/wp-admin’. However, I just commented the second function out and it seems a subsriber still does not have access to /wp-admin.

    So, I guess

    function disable_admin_bar() {
    	if (current_user_can( 'subscriber' ) ) {
    		show_admin_bar( false );
    	}
    }
    add_action( 'after_setup_theme', 'disable_admin_bar' );

    takes care of both (and second function is obsolete)?

    #213788
    Robin W
    Moderator

    so what code are you using ?

    Robin W
    Moderator

    are the min files copied from elsewhere? or did you create the code?

    #213786
    Robin W
    Moderator

    something strange going on!

    I can only suggest it could be a theme or plugin issue

    Themes

    As a test switch to a default theme such as twentyfifteen, 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

    I’d start by taking out any code in your child theme’s functions file !

    Robin W
    Moderator

    not sure why you need the second bit of code?

    Robin W
    Moderator

    if it works, code looks fine, but I haven’t looked at in detail 🙂

    p3t3rr
    Participant

    Hi Robin,

    thank you for your reply. The code in that resource isn’t quite satisfactory but it gave me a head start.

    I came up with the following function to disable the wp toolbar:

    // disable wp toolbar on the frontend of website for role:'subscriber'
    function disable_admin_bar() {
    	if (current_user_can( 'subscriber' ) ) {
    		show_admin_bar( false );
    	}
    }
    add_action( 'after_setup_theme', 'disable_admin_bar' );

    and the following to disable wp-admin:

    // not allow access to wp-admin backend for role:'subscriber'
    function sub_no_read_wpadmin(){  
        $role = get_role( 'subscriber' );
        $role->remove_cap( 'read' );    
    }
    add_action( 'admin_init', 'sub_no_read_wpadmin' );

    Hopefully this is sound. Do you see any problems with this implementation?

    #213752

    In reply to: Indent forums

    Chuckie
    Participant

    Do you really have two :: in your CSS file? There should be one.

    #213744
    Robin W
    Moderator

    put this in the custom css part of your theme

    .archive-description {
    display : none !important ;
    }
    #213738

    In reply to: Archive

    Mushlih Almubarak
    Participant

    Hi
    What I want to get rid of is the one marked with the arrow (which I underlined) in the image: https://prnt.sc/u0h1vn, not what I gave sign (x)
    And your code changes to writing that I marked (x)

    #213734

    In reply to: Archive

    Robin W
    Moderator

    it should work, try

    add_filter( 'bbp_get_forum_archive_title', 'tcv_forum');
    
    function tcv_forum () {
    	return 'forum-diskusi' ;
    }
    #213731

    In reply to: Archive

    Mushlih Almubarak
    Participant

    Hi
    Thank you for giving the code
    But you don’t seem to understand what I mean
    Your code omits “Diskusi” instead of “Arsip”
    What I want is to remove the words “Arsip” at the top (not on the page), not to remove the words “Diskusi”
    How to solve it?
    Thank you

    #213730

    In reply to: Archive

    Robin W
    Moderator

    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

    add_filter( 'bbp_get_forum_archive_title', 'tcv_forum');
    
    function tcv_forum () {
    	Return 'Forum' ;
    }
    p3t3rr
    Participant

    Hi there,

    I am currently setting up a bbpress forum. This is why I post a view threads atm because I have questions. Hopefully, it’s not perceived as spam.

    I know that this is not a bbpress issue, more of a wordpress thing in general. However, I guess that most bbpress developers/admins have solved this issue – therefore I ask it here.

    I want to disable access to wordpress admin dashboard for all normal forum participants (role: subscriber/participant).

    I have done some searching and found that it could be achieved through the following custom php.

    disable wp-admin:

    // redirect back to homepage and not allow access to wp backend for subscribers
    function rkk_redirect_admin(){
    	if ( ! wp_doing_ajax() && ! current_user_can( 'edit_posts' ) ) {
            wp_redirect( site_url() );
            exit;
        }
    }
    add_action( 'admin_init', 'rkk_redirect_admin' );

    disable wp admin toolbar:

    // disable wp toolbar on the frontend of website for subscribers
    function rkk_disable_admin_bar() {
        if( ! current_user_can('edit_posts') )
            add_filter('show_admin_bar', '__return_false');
    }
    add_action( 'after_setup_theme', 'rkk_disable_admin_bar' );

    I included that code in functions.php of childtheme. However, it does not seem to have an effect. Subscriber can still access wp-admin and can see the wp toolbar in the front end.

    Anybody have a good solution for this? I don’t want to use an extra plugin for that.

    thank you for helping. best regards, peter

    #213710
    p3t3rr
    Participant

    Hi,

    I want to display a forum specific sidebar on all bbp pages. For this I include the desired widgets in design > widgets > Forum. The sidebar is correctly shown on many bbpress pages, but not all. For example the forum index page and the bbpress profile page (‘/forum/user-base/username/’) does not have the sidebar.

    How can I have the sidebar (named ‘Forum’) display on those pages as well? I am looking for a little php function which I can include in the child theme functions.php. I am using the Enfold theme which generally seems to work very well with bbpress.

    I had the same problem when I was experimenting with buddypress (I decided to not use buddypress though). To have the sidebar displayed on all buddypress pages we came up with the following working function:

    //custom forum sidebar on buddypress pages
    add_filter('avf_custom_sidebar','avf_custom_sidebar_mod');
    function avf_custom_sidebar_mod($sidebar) {
    	if ( bp_current_component() ) {
    		$sidebar = "Forum";
    	}
    	return $sidebar; 
    }

    Can this function be adjusted to work with bbpress? I thought maybe just change the if condition to if ( bbp_loaded() ). But it does not seem to work.

    Any help would be greatly appreciated. Best regards, peter

    #213692
    vorahasti
    Participant

    I want image to be displayed in left of forum title. Any code that I can add to snippet?

    #213658
    Robin W
    Moderator

    #bbpress-forums is the ID for forums – suggest you ask here on how to hide breadcrumb

    https://wordpress.org/support/plugin/breadcrumb-navxt/

    #213651
    sab
    Participant

    Hello,
    I would like to select with CSS selector for BBpress forum pages to hide Breadcrumb NavXT.
    Is there a CSS code ?
    THanks for your help.

    #213648
    franckc2
    Participant

    Hi I have embedded a forum into a WP page with the shortcode.

    Displaying and browsing the forum works as it should but when I clik on the “subscribe” button, the page reloads and I’m not subscribe for alerts on that forum.

    Seems to be doing that only when I embed the forum in another page.

    If I go directly to the forum, then the button works.
    Looks like something with the “rewrite” string or something like that.

    Any clue how I could fix that ?

    #213647

    In reply to: Sort topics in a Forum

    Robin W
    Moderator

    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

    add_filter('bbp_has_replies_query', 'rew_modify_replies_query');
    
    function rew_modify_replies_query($bbp_r) {
    $bbp_r['order'] = 'DESC';
    return $bbp_r;
    }
    
    add_filter('bbp_show_lead_topic', 'rew_show_lead_topic');
    
    function rew_show_lead_topic () {
    	return true ;
    }
Viewing 25 results - 2,426 through 2,450 (of 32,462 total)
Skip to toolbar