Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 426 through 450 (of 32,358 total)
  • Author
    Search Results
  • #237228

    In reply to: remove user Forum Role

    newtech1
    Participant

    I found this code to remove IP address:

    function vvd_no_view_ip ($author_ip, $r, $args) {
        return __return_empty_string ();
    }
    add_filter ('bbp_get_author_ip','vvd_no_view_ip', 10, 3);

    I was in wrong functions.php file. Did not realize I needed to do these edits in my theme functions.php.

    #237227

    In reply to: remove user Forum Role

    newtech1
    Participant

    I found these two different codes that is supposeto what I want (I do not want moderator or keymaster roles shown in forntend), but when I insert either in the bbpress functions.php page nothing happens.

    
    function hide_role ($args) {
    $args['show_role'] = false ;
    Return $args ;
    }
    add_filter ('bbp_before_get_reply_author_link_parse_args', 'hide_role') ;
    function role_show () {
    $displayed_user = bbp_get_reply_author_id() ;
    $role = bbp_get_user_role( $displayed_user);
    if ( bbp_is_user_keymaster($displayed_user) ||$role == 'bbp_moderator') $args['show_role'] = true ;
    else $args['show_role'] = false ;
    return $args ;
    }
    add_filter ('bbp_before_get_reply_author_link_parse_args', 'role_show' );

    I also do not want IP address shown for anyone on the frontend. (Yes even for moderators ND KEYMASTERS)

    #237214
    newtech1
    Participant

    On our forum topics there are no replies, thus there is no need for the Subscribe button to appear on topic posts. Where do I go to edit code to remove Subscribe?

    #237210
    Robin W
    Moderator

    so your code shows

    .bbp-breadcrumb, .bbp-breadcrumb-home {
    font-size: 14px !important;
    font-family: Roboto !important;
    }

    and your image shows this being the setting, so I am confused as to what is not working?

    I am not doubting that you are seeing an issue, this is just me getting to understand the issue.

    #237182
    lmstearn
    Participant

    @robin-w, thank you for the code and idea, will try it out. πŸ™‚

    #237179
    enkoes
    Participant

    Hi, I also want to know how do I make use of this filter bbp_current_user_can_access_create_topic_form to make one of my forum solely for admin posting only? Appreciated if @scottmotion can share your solutions with us.

    Regards.

    #237173
    Robin W
    Moderator

    untested, but this should work

    add_filter( 'bbp_get_topics_per_page', 'rew_amend_topics', 10 , 2) ;
    
    function rew_amend_topics ($retval, $default ) {
    	$forum = bbp_get_forum_id() ;
    	if ($forum == 123) $retval = 10 ;
    	if ($forum == 456) $retval = 5 ;
    return $retval ;
    }

    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

    shimdayo
    Participant

    I use bbpress in Japanese.

    In the bbpress search window, if you search for two or more words with double-byte spaces, no search results will appear.

    I tried replacing half-width with full-width, and it worked in the wordpress search window, but not in the bbpress search window.

    advice please.
    thank you.

    function empty_search( $query ) {
        if ( $query->is_main_query() && $query->is_search && ! $query->is_admin ) {
        $s = $query->get( 's' );
        $s = str_replace('γ€€',' ', $s );
        $query->set( 's', $s );
        }
    }
    add_action( 'pre_get_posts', 'empty_search' );
    #237151
    Robin W
    Moderator

    It looks like it is theme/builder related

    the width is being set by

     .h-row>.h-col-lg-auto {
        flex:0 0 auto;
        width:auto;
        max-width:100%
      }

    You may need to talk to your theme provider, or read the documentation

    #237146
    newtech1
    Participant

    Well thus far it looks like this works:
    Remove this code:

    if ( empty( $r['links'] ) ) {
    			$r['links'] = apply_filters( 'bbp_topic_admin_links', array(
    				'edit'    => bbp_get_topic_edit_link   ( $r ),
    				'merge'   => bbp_get_topic_merge_link  ( $r ),
    				'close'   => bbp_get_topic_close_link  ( $r ),
    				'stick'   => bbp_get_topic_stick_link  ( $r ),
    				'trash'   => bbp_get_topic_trash_link  ( $r ),
    				'spam'    => bbp_get_topic_spam_link   ( $r ),
    				'approve' => bbp_get_topic_approve_link( $r ),
    				'reply'   => bbp_get_topic_reply_link  ( $r )
    			), $r['id'] );
    		}
    
    #237145
    newtech1
    Participant

    I want to remove the moderation links that appear within a topic post.

    moderator links

    I believe this is controlled by the following in bbpress/includes/topics/template.php. What edit would I do if this is the correct area to edit:

    function bbp_get_topic_admin_links( $args = array() ) {
    
    		// Parse arguments against default values
    		$r = bbp_parse_args( $args, array(
    			'id'     => bbp_get_topic_id(),
    			'before' => '<span class="bbp-admin-links">',
    			'after'  => '</span>',
    			'sep'    => ' | ',
    			'links'  => array()
    		), 'get_topic_admin_links' );
    
    		if ( empty( $r['links'] ) ) {
    			$r['links'] = apply_filters( 'bbp_topic_admin_links', array(
    				'edit'    => bbp_get_topic_edit_link   ( $r ),
    				'merge'   => bbp_get_topic_merge_link  ( $r ),
    				'close'   => bbp_get_topic_close_link  ( $r ),
    				'stick'   => bbp_get_topic_stick_link  ( $r ),
    				'trash'   => bbp_get_topic_trash_link  ( $r ),
    				'spam'    => bbp_get_topic_spam_link   ( $r ),
    				'approve' => bbp_get_topic_approve_link( $r ),
    				'reply'   => bbp_get_topic_reply_link  ( $r )
    			), $r['id'] );
    		}
    
    #237091
    Frederic Pilon
    Participant

    Oh sorry, I did not mention, i’m the one building the car;

    I can do changes in the code as you need; could even give you access to the site if it would help; but it does really feel like I’m hitting a plugin bug with those pages;

    It kinda looks like if someone stripped all the tags on the output.

    #237088
    Frederic Pilon
    Participant

    It is a custom theme.

    But trying the twenty twentytwo theme gives a white page.

    Am i supposed to load something in particular? I have control over the code so I can make some changes.

    Frederic Pilon
    Participant

    I’m looking for the shortcode or bit of code needed to show this bit of the current site?

    #237080

    In reply to: Several questions

    Robin W
    Moderator

    no problem.

    on no. 3 there is a bbpress profile and a wordpress profile. Other plugins may also add their own profile pages.

    If it is not the bbpress profile page you want it to go to, then do come back, I can probably give you some code.

    #237078

    In reply to: Several questions

    eefkedigibitch
    Participant

    Hi Robin,
    Thanks again for your help!

    On. no 4
    Yes, it got rid of the home / Yes the page is .com/forum and yesy it’s set with the shortcode.
    I tried a totally different URL like facebook, but it keeps directing me to .com/forumS with the extra s on the end.
    I also tried to set the Forum Root slug to forum instead of forums, but that didn’t work the first time. Now I did that again and it does work! So it’s fixed now.
    Conclusion; the root slug needs to be the same as the page name. Actually kinda logical, hihi…

    On no. 3
    Never mind I’ll find my way I got confused I think.

    So again, Robin you’re the best!
    Thanks for helping me!

    #237073

    In reply to: Several questions

    Robin W
    Moderator

    on no. 4

    So style pack got rid of the home – yes ? that shows that it is doing something.

    So you have a page with a permalink of forum? yes?
    With presumably the [bbp-forum-index] shirtcode in it – yes ?

    and you have set the breadcrumb root to …com/forum. As a test can you try setting this to

    https://www.facebook.com/

    and see if it takes you to facebook

    This will tell us if style pack is executing the link, but something else in your site is redirecting.

    #237066

    In reply to: Forum default

    newtech1
    Participant

    Thank you for the clarification of the analogy. Yes, that certainly makes sense, and I certainly would like to just use the car. BUT no one has been able to help me make ACF plugin to work on the frontend. ACF has me going to bbpress and bbpress has me going to ACF. (The code that is working great on the backend I have not been able to work on the front end. Spent hours upon hours trying to this.

    What I do not understand is why an admin/moderator would ever want a topic to fall under the category of no forum. If nothing else I will figure out a way to just make it so the first option has no words so the poster sees it looks strange, and/or find a way to add additional text below it to tell them to choose the Fishing Report Forum. (I will be giving each new user an instruction pages but I can see many topics going into la la land.

    Thanks for what you do at the kitchen table. I will deal with the train. πŸ™‚

    #237065

    In reply to: Forum default

    Robin W
    Moderator

    because I am feeling in a good mood, I did a bit of searching.

    There is a way, but you have to edit a bbpress file.

    so go to

    \bbpress\includes\admin\metaboxes.php

    and remove line 445 which says

    'show_none' => esc_html__( '&mdash; No forum &mdash;', 'bbpress' ),

    and save it back

    You will need to do this again if bbpress issues an update, but those are few and far between.

    #237062

    In reply to: Forum default

    Robin W
    Moderator

    the car/train analogy was you using the backend for frontend tasks πŸ™‚ The backend is designed for admins not users.

    Any code can be changed, but I’m just a guy sat in his kitchen trying to help others and only so much I can do, and spending several hours working out how to achieve this is beyond my current resources – sorry.

    #237059

    In reply to: Forum default

    newtech1
    Participant

    I only have one forum. It is called Fishing Report Forum. It makes no sense to me when you go into Topic Attributes why there is even an option for __ No forum ___ under Forum:

    If you are creating a topic in a bulletin board/forum why would it not go into a forum instead of no forum.

    There is no way in code to remove the ___No forum___ option under Topic Attributes?

    My car has always been Fishing Report Forum and never No forum, so want to stick with my Fishing Report Forum car, not go to a train. πŸ™‚

    #237056

    In reply to: Problem adding table

    Robin W
    Moderator

    Ok, I tried to look, but cannot see any obvious fix for this, I’m not sure how the code is working that sends this – sorry I’m not able to help further.

    #237052
    Robin W
    Moderator

    it can be combinations, so yes, I want to eliminate that.

    Given that at the moment I have the problem as :

    On registration:

    worpdress has no role
    bbpress has participant role

    so you need subscriber role to be set

    then I am struggling to see how bbpress is ‘unsetting’ the subscriber role.

    #237031
    Robin W
    Moderator

    Now I have to edit the file

    ok so you have already put :

    function rkk_widgets_init() {
     
        register_sidebar( array(
            'name' => __( 'bbPress Sidebar', 'rkk' ),
            'id' => 'bbp-sidebar',
            'description' => __( 'A sidebar that only appears on bbPress pages', 'rkk' ),
            'before_widget' => '<aside id="%1$s" class="widget %2$s">',
            'after_widget' => '</aside>',
            'before_title' => '<h3 class="widget-title">',
            'after_title' => '</h3>',
        ) );
        }
     
    add_action( 'widgets_init', 'rkk_widgets_init' );

    into your child theme functions file – yes ?

    and then did this

    I chose the left-sidebar-page.php of my theme, copied it into my child theme and replaced <?php get_sidebar(); ?> with <?php dynamic_sidebar( β€˜bbp-sidebar’); ?>. Because I read this in another topic of a theme salient user.

    which replaces the second part of 26, as you have chosen the left-sidebar rather than just sidebar

    yes ?

    so what exactly are you stuck on?

    #237025
    eefkedigibitch
    Participant

    Hi there,

    I’m trying to create a specific sidebar in my website. I’ve been reading about it in this forum and I’m following step 26 of the article ‘Layout and functionality – Examples you can use’.
    What I did so far;
    1. I added the code to register the sidebar in my functions.php of my child theme.
    2. I chose the left-sidebar-page.php of my theme, copied it into my child theme and replaced <?php get_sidebar(); ?> with <?php dynamic_sidebar( ‘bbp-sidebar’); ?>. Because I read this in another topic of a theme salient user.
    Now I have to edit the file like the example that’s mentioned in the article, but I don’t understand it. So this is where I get stuck.

    Can someone please help me?! I’d really appreciate it!

    Kind regards,
    Eve

    Ps. My website has a shop and LearnDash courses. The forum is meanly for the course participants and should be connected to the specific LearnDash courses. The theme I’m working with is Salient. The only other sidebar I have is the woocommerce sidebar.

Viewing 25 results - 426 through 450 (of 32,358 total)
Skip to toolbar