Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 601 through 625 (of 32,295 total)
  • Author
    Search Results
  • #234742
    valarcher
    Participant

    Hi – I’m trying to change the title of my forum index page. I tried item 3 method 2 at:

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


    — saving my index page as /members (not /forums) as per WP settings, and then tried to give members page in wordpress the title “Private Forums” (instead of title Members). It displays as “Private Forums” (not “Members”) in the breadcrumb. But still on main index page, it displays only the title “Forums.”

    I’m using the shortcode [bbp-forum-index] on /members page as I have text above and below it.

    What can I add to functions.php that will force that index page to display the title “Private Forums”?

    Thank you!

    #234740
    Sergio De Falco
    Participant

    My step up, also install/update Gutenberg standalone plugin to the latest version and add this to your own plugin / theme functions.php

    function envireit_bbp_register_forum_post_type( $args ) {
    	$args['show_in_rest'] = true;
    
    	return $args;
    }
    
    add_filter( 'bbp_register_forum_post_type', 'envireit_bbp_register_forum_post_type' );
    
    function envireit_bbp_register_topic_post_type( $args ) {
    	$args['show_in_rest'] = true;
    
    	return $args;
    }
    
    add_filter( 'bbp_register_topic_post_type', 'envireit_bbp_register_topic_post_type' );
    
    function envireit_bbp_register_reply_post_type( $args ) {
    	$args['show_in_rest'] = true;
    
    	return $args;
    }
    
    add_filter( 'bbp_register_reply_post_type', 'envireit_bbp_register_reply_post_type' );

    With this you will be able to build via site builder, your own forums, topics and replies page. Just replace the content loop with the article content block.

    #234731
    3dbyte
    Participant

    I tested your codes working without problem. By the way I didn’t use header color. Just footer enough because inside “forum index styling” changing already.
    Sincerely thanks Robin, have a good day.

    #234730
    Robin W
    Moderator

    waiting for an email from someone else, so playing with this – this should work

    #bbpress-forums li.bbp-header {
    	background-color: blue;
    }
    #bbpress-forums li.bbp-footer {
    	background-color: green;
    }

    if you put this in

    dashboard>settings>bbp style pack>custom css

    then it will exceute at the right point

    let me know if it doesn’t work

    #234727
    Robin W
    Moderator

    In suspect if you are posting as you (eg say a keymaster) then it won’t do the check, can’t say for sure without delving into code, but try as a participant

    #234722
    Mike Witt
    Participant

    That’s what I was planning to do, but I can’t replicate the problem. When I just make a couple of posts and replies, I don’t get the php notice. That’s why I was thinking maybe it wasn’t bbPress. There must be something special I need to do, to invoke the “blacklist” thing? It happens every once in a while. But I can’t find an action that causes it to happen. I gather that you don’t see it happening, right?

    [10-Mar-2023 04:55:26 UTC] PHP Deprecated: Function get_option was called with an argument that is <strong>deprecated</strong> since version 5.5.0! The "blacklist_keys" option key has been renamed to "disallowed_keys". in .../public_html/wp-includes/functions.php on line 5667

    #234716

    In reply to: Forum Issues

    Robin W
    Moderator
    #234713
    Robin W
    Moderator

    so try this code, amending the numbers to what you want

    if (wp_is_mobile()) {
    add_filter ('bbp_get_topics_per_page', 'mobile_topics_per_page') ;
    add_filter ('bbp_get_replies_per_page', 'mobile_replies_per_page') ;
    }
    
    function mobile_topics_per_page () {
    	return '4' ;
    }
    
    function mobile_replies_per_page () {
    	return '3' ;
    }

    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

    #234694

    In reply to: MySQL Syntax Error

    Robin W
    Moderator

    ok, not quite sure why this occurred, but the bit that says

    ('4185', 'as__bbp_favorites, '312810')

    is lacking a closing ‘ on 'as__bbp_favorites so should read

    ('4185', 'as__bbp_favorites', '312810')

    Is this a one off, or is it now doing this everytime?

    #234692
    paulmist
    Participant

    This works great with a minor tweak…

    if( !is_user_logged_in() && $rep_position > 1 )

    However – is it possible to hide replies and not just their content?

    Tried using bbp_get_reply as a filter with no luck.

    #234685
    ljmac
    Participant

    Hi,

    A MySQL syntax error has started cropping up recently, even though I have made no changes that might be related to this (same MySQL version, same PHP version, same bbPress version, same WordPress version). Can anyone enlighten me on what might be causing this?

    Once again, this only started happening recently despite the lack of any significant related changes – I have been doing forum repairs for years without any errors.

    [09-Mar-2023 05:01:55 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘312810’)’ at line 2 for query INSERT INTO as_usermeta (user_id, meta_key, meta_value) VALUES
    (‘4185’, ‘as__bbp_favorites, ‘312810’); made by require_once(‘wp-admin/admin.php’), do_action(‘load-tools_page_bbp-repair’), call_user_func_array, bbp_admin_repair_handler, call_user_func, bbp_admin_repair_user_favorites

    #234680
    wpturk
    Participant

    This should do the job: (put this in your functions.php)

    function bb_auth_reply_view( $reply_id ) {
            $reply_id = bbp_get_reply_id( $reply_id );
    
            // Check if password is required
            if ( post_password_required( $reply_id ) )
            return get_the_password_form();
    
            $content = get_post_field( 'post_content', $reply_id );
    
            // first topic reply shouldn’t be hiding
            $rep_position = bbp_get_reply_position($reply_id);
    
            // if user is not logged in and not the first post topic
            if( !is_user_logged_in() ) {
                    return "Replies only viewable for logged in users";
            } else {
                    // return normal
                    return $content;
            }
    
    }
    add_filter( 'bbp_get_reply_content', 'bb_auth_reply_view' );
    #234659
    nobody
    Participant

    i use this code for differentiate lead topic :

    function custom_bbp_show_lead_topic( $show_lead ) {
    $show_lead[] = ‘true’;
    return $show_lead;
    }

    add_filter(‘bbp_show_lead_topic’, ‘custom_bbp_show_lead_topic’ );

    now I want to display @mentionname too on lead topic, basically it’s like bbpress forum, however I can’t do it, anyone can help ?

    #234658
    webcreations907
    Participant

    The below code should set it to unlimited number of forums, either paste the code into your functions.php file within your theme, or use the Code Snippets plugin listed above.

    
    
    if(!function_exists('bbp_increase_forum_display_count')){
    	function bbp_increase_forum_display_count( $args = array() ){
    		$args['posts_per_page'] = -1;
    		return $args;
    	}
    }
    add_filter( 'bbp_after_has_forums_parse_args', 'bbp_increase_forum_display_count' );
    
    
    #234648
    nobody
    Participant

    this is what I’ve been looking for, thanks….permitt to copy code.

    #234642
    3dbyte
    Participant

    Hi Robin, your bbpstyle plugin is very nice but unfortunately it’s breaking my theme. (Jannah premium) So I couldn’t use. On the other hand Ian Stanley’s moderation plugin very nice. I’m using it for test site but last updating 9 years ago. I’m confused to use in real site. No code for function file? I want to approve for replies and topics not registered users.

    #234613
    Robin W
    Moderator
    #234609
    webcreations907
    Participant

    Should have mentioned that you should added that into a child theme functions.php file so that when you update the theme you won’t lose that code.


    @robin-w
    usually recommends a code snippet plugin for adding custom code, but I don’t recall the name of that plugin.

    #234608
    webcreations907
    Participant

    Try adding the below code to your theme’s functions.php file, should make the userpages full width with no sidebar.

    
    
    if( !function_exists('enkoes_magbook_userpage_css_class') ){
    	function enkoes_magbook_userpage_css_class( $classes ){
    		if( function_exists('bbp_is_single_user') &&  bbp_is_single_user()){
    			$classes[] = 'magbook-no-sidebar';
    		}
    		return $classes;
    	}
    }
    add_filter('body_class', 'enkoes_magbook_userpage_css_class');
    
    if( !function_exists('enkoes_magbook_userpage_options') ){
    	function enkoes_magbook_userpage_options( $options = array() ){
    		
    		if( function_exists('bbp_is_single_user') &&  bbp_is_single_user()){
    			$options['magbook_sidebar_layout_options'] = 'nosidebar';
    			$options['magbook_blog_layout'] = '';
    		}
    		return $options;
    
    	}
    }
    add_filter('magbook_get_option_defaults_values', 'enkoes_magbook_userpage_options',100);
    
    

    You may have to get rid of that bbpress.php file you added.

    I haven’t used Magbook theme before, so let me know if that works out for you.

    😉

    #234590
    valarcher
    Participant

    but problem is not with forums – they display full-width – it’s with forum index/archives. Problem is the forum index is treated as blog archives. I need 3-col blog archives for the rest of my site and 1-col for forum archives.
    I tried entering the shortcode [bbp-forum-index] on the /members page — which is set to full-width in css as above — but that doesn’t solve the problem of the index of forums displaying only in col 1 of the 3-col grid I’m using for blog archives. To get them to display full-width I have to target each individually in the index, e.g. #bbp-forum-9475.
    I know the quick but ugly fix is to set all my blog archives to 1-col (that is, full width) but I’m looking for the beautiful fix of setting only my forum archives to 1-col. Is there any way to do this?

    #234576
    nobody
    Participant

    hello @robkk
    can u help me, just displaying Registered Users on shortcode….

    #234565
    wpturk
    Participant

    This is related to your wordpress theme (template file). Select a full-width theme template file in your forum settings. If you are displaying your forums via shortcode, the shorcode can be placed on full-width page.

    #234554
    Robin W
    Moderator

    try

    bbp_get_displayed_user_id()

    that should work.

    #234551
    nednednerb
    Participant

    Hi there.

    This is about my login page here:
    https://vancouvergathers.ca/wp-login.php
    I’m using WordPress 6.1.1, Elementor Pro 3.11.3 with Hello Elementor theme,
    BBPress version 2.6.9, bbp style pack 5.3.6,
    I’m using LoginPress but that was installed after the issue described below was already present.

    Underneath the captcha and above the blue Login button is an extra button I want to remove. It says “Log in or sign up” but the button just redirects to the login page itself.

    When I inspect the page in Chrome it tells me the element might be div.bbp-button-wrapper or button.bsp-register.

    Do you know how I can find out where this button is being invoked so I can remove it from the code? I am not an expert web developer and I cannot solve this issue on my own.

    Any help would be appreciated. Thanks,
    Brenden

    #234517
    cbreezy
    Participant

    Took awhile but I fixed it by adding this code to the bbpress.css file in my child theme:

    #bbpress-forums div.bbp-reply-author a.bbp-author-link {
    padding: 0 0;
    }

Viewing 25 results - 601 through 625 (of 32,295 total)
Skip to toolbar