Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 10,326 through 10,350 (of 32,504 total)
  • Author
    Search Results
  • #153657
    kendorama
    Participant
    function remove_counts() {
    $args['show_topic_count'] = false;
    $args['show_reply_count'] = false;
    $args['count_sep'] = '';
     return $args;
    }
    add_filter('bbp_before_list_forums_parse_args', 'remove_counts' );

    I’ve been pasting that since the beginning. It’s at the bottom of my child theme’s function.php.

    #153656
    kendorama
    Participant

    I have tried the new code. What I’m saying is that even though the pastes in here look wrong, it’s not. It’s because i’m not using “code” in here that it formats it.

    I’ve copy pasted the code you provided, which was what I was using before (I just pasted it without “code”) here.

    I’ve literally spent hours trying to fix this solution.

    #153655
    Robin W
    Moderator

    Yes. But that code is exactly the code I already had in my functions.php.

    if so you haven’t tried the new code ! re-read the documentation

    #153653
    kendorama
    Participant

    Yes. But that code is exactly the code I already had in my functions.php.

    For some reason when I paste in this thread it changes certain things like ” to “.

    #153652

    In reply to: bbpres admin

    Robin W
    Moderator

    Try

    Codex

    #153651
    Robin W
    Moderator

    Presume you have tried the new code?

    #153645
    Robin W
    Moderator

    STOP !!!

    Ok, the codex has a couple of errors as it had not been updated following the release of 2.5.4 and also had some text that had been badly edited.

    You have two choices – you cannot do both

    either

    Step by step guide to setting up a bbPress forum – part 3

    which I have just updated with new code, or put this in your functions file

    function remove_counts() {
    $args['show_topic_count'] = false;
    $args['show_reply_count'] = false;
    $args['count_sep'] = '';
     return $args;
    }
    add_filter('bbp_before_list_forums_parse_args', 'remove_counts' );
    

    Both work

    #153642
    temi_t
    Participant

    I am trying to set up a discussion forum on a website I manage using the step by step guide provided by bbpress.

    I got through the steps of creating a forum and topic. However when I click on the forum a message displays that 1 topic is present in the forum. Then another message says “Oh bother! Nothing was found here!”

    I have uninstalled the bbpress and re-installed it but I’m still running into the same problem.

    Here’s a link to the forum page. It can also be accessed from the website’s main menu as follows: SURVEY >> PTRC Forums

    My WordPress version is: 4.0
    bbPress version: 2.54

    Thanks in advance

    #153637
    kendorama
    Participant

    I read this: https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum-part-3/

    and placed the same code into the loop-single-forum.php but it has an error.

    #153636
    kendorama
    Participant

    Btw I’m not sure why the paste shows the improper type, in the actual code I paste into the function.php it looks like the correction you gave me.

    #153632
    Robin W
    Moderator

    bbPress forums can be private, public or hidden.

    private are only viewable if logged in, hidden are only viewable by mods and above.

    However my private groups plugin will give you all the control you need

    https://wordpress.org/plugins/bbp-private-groups/

    re importing

    https://codex.bbpress.org/import-forums/mingle/

    #153619
    shelleyheath
    Participant

    Hi There,

    I have a website which restricts content via the Groups plugin (https://wordpress.org/plugins/groups/)

    On one of the restricted pages I am using the following code to insert a forum: [bbp-single-forum id=12492]

    However when working in the frontend and adding a topic, sometimes it renames the actual page… The forum ending to the url just tacks itself to the page on which [bbp-single-forum id=12492] is featured.

    Forum page:

    PCLC 1: A TIME FOR INTRODUCTIONS!

    Original url:

    http://lifepurposecoachingcenters.com/classrooms/pclc-1/

    Reset url after it goes wrong:

    http://lifepurposecoachingcenters.com/classrooms/pclc-1-a-time-for-introductions/

    Any ideas would be much appreciated!

    Thanks very much!

    #153616
    cubeacid
    Participant

    Ok, thanks for clarifying things, but I’m not familiar with modifying php-code, so I still would need help in this problem :/

    #153615
    Robin W
    Moderator

    create a directory on your theme called ‘bbpress’
    ie wp-content/%your-theme-name%/bbpress
    find
    wp-content/plugins/bbpress/templates/default/bbpress/form-topic.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/%your-theme-name%/bbpress/form-topic.php
    bbPress will now use this template instead of the original

    I was only suggesting you start with looking at lines 42, I haven’t actually looked seriously at the code, I don’t have time at the moment 🙂

    #153613
    Robin W
    Moderator

    ok, the last line has a wrong “‘” type

    replace this with

    add_filter('bbp_before_list_forums_parse_args', 'remove_counts' );

    and it should be fine

    #153610
    Robin W
    Moderator

    This worked well for adding the username, so if i can just remove the full name/image, that out to do it.

    If you mean the two bits above what you have just added , then the simplest would be

    create a directory on your theme called ‘bbpress’
    ie wp-content/%your-theme-name%/bbpress
    find
    wp-content/plugins/bbpress/templates/default/bbpress/loop-single-reply.php
    Make a copy of this file, and put in in the directory called bbpress that you created above, so you end up with
    wp-content/%your-theme-name%/bbpress/loop-single-reply.php
    bbPress will now use this template instead of the original

    Then simply delete line 45

    <?php bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => true ) ); ?>
    
    #153608
    david_ma
    Participant

    How about remove the authors real name and email linked avatar? My users want to use their username only, and a custom avatar.

    This worked well for adding the username, so if i can just remove the full name/image, that out to do it.

    /**
    * Add @mentionname after bbpress forum author details
    */
    
    add_action( 'bbp_theme_after_reply_author_details', 'mentionname_to_bbpress' );
    function mentionname_to_bbpress () {
    $user = get_userdata( bbp_get_reply_author_id() );
    if ( !empty( $user->user_nicename ) ) {
    $user_nicename = $user->user_nicename;
    echo "@".$user_nicename;
    }
    }
    #153598

    In reply to: change style

    Robin W
    Moderator
    #153596
    kendorama
    Participant

    Nope. I copied all that into my functions and it didn’t work. I’ve googled other solutions which are along the same lines but different code that’s used. I figured it was cause that was outdated and bbPress version is different.

    No other solution?

    #153592
    chero123
    Participant

    solved, they can close the topic …

    with shortcode

    #153591
    lkharrell
    Participant

    nevermind! I just figured it out!

    It was

    #bbpress-forums a.bbp-author-name {
       white-space: nowrap;
       background: none;
       border: none;
    }
    #153588
    lkharrell
    Participant

    Hey guys,

    Thanks for getting back to me.
    Jessy, the code you provided did not accomplish it… here is the link to the page if y’all want to check out the source code.

    #153586
    Robin W
    Moderator

    not sure why

    I’ve read https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/ among other tips.

    isn’t working for you?

    #153580
    kendorama
    Participant

    I’ve googled and searched the support forums and it seems the answers are outdated and don’t currently work on this version of bbPress.

    I’ve read https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/ among other tips.

    Any help?

    #153553
    jessy
    Participant

    @cubeacid: You want this: Do not allow users to publish new topics, just replies on your topics. Correct?

    1, Install plugin: WPFront User Role Editor
    2, Go to Roles => All roles => and choose Participant, it has 8 capabilities
    3, You need uncheck publish_topics and edit_topics and assign_topic_tags and delete_topic_tags
    4, with this plugin you can do it because it is built in role from plugin bbPress
    5, But, we can customize it with filter function pasted below
    6, Jast paste it into function.php and refresh the page in admin plugin WPFront User Role Editor in Participate role how magicaly capabilities are removed 🙂
    7, If the participant or regular registered user will go on topics, they will be message “You cannot create new topics.” and if user click on your own created topic, he can reply 🙂

    Paste it into functions.php

    function my_custom_get_caps_for_role_filter($caps, $role)
    {
        /* Only filter for roles we are interested in! */
        if ($role == 'bbp_participant' )
            $caps = my_custom_get_caps_for_role($role);
    
        return $caps;
    }
    add_filter('bbp_get_caps_for_role', 'my_custom_get_caps_for_role_filter', 10, 2);
    
    function my_custom_get_caps_for_role($role)
    {
        switch ($role) {
            case 'bbp_participant':
                return array(
                    
                    // Primary caps
                    'spectate' => true,
                    'participate' => true,
                    'moderate' => false,
                    'throttle' => false,
                    'view_trash' => false,
                    
                    // Forum caps
                    'publish_forums' => false,
                    'edit_forums' => false,
                    'edit_others_forums' => false,
                    'delete_forums' => false,
                    'delete_others_forums' => false,
                    'read_private_forums' => false,
                    'read_hidden_forums' => false,
                    
                    // Topic caps
                    'publish_topics' => false,
                    'edit_topics' => false,
                    'edit_others_topics' => false,
                    'delete_topics' => false,
                    'delete_others_topics' => false,
                    'read_private_topics' => false,
                    
                    // Reply caps
                    'publish_replies' => true,
                    'edit_replies' => true,
                    'edit_others_replies' => false,
                    'delete_replies' => false,
                    'delete_others_replies' => false,
                    'read_private_replies' => false,
                    
                    // Topic tag caps
                    'manage_topic_tags' => false,
                    'edit_topic_tags' => false,
                    'delete_topic_tags' => false,
                    'assign_topic_tags' => false
                );
                break;
            default:
                return $role;
        }
    }

    I have try that ad for me it works.

Viewing 25 results - 10,326 through 10,350 (of 32,504 total)
Skip to toolbar