Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 676 through 700 (of 32,358 total)
  • Author
    Search Results
  • #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;
    }

    #234498
    DeepBlue
    Participant

    Hi
    Another solution
    add to your css :

    form.bbp-login-form {
        display: none!important;
    }
    #234490
    valarcher
    Participant

    Wow that seems like a complex solution to something that the codex says is a simple checkmark next to Settings > Forums > Forum Features

    #234489
    Robin W
    Moderator

    please post the code you are using

    #234487
    wpturk
    Participant

    Hi, you can put this in your functions.php to fix the problem:

    if( !function_exists( 'bbpress_browser_supports_js' ) ){
            function bbpress_browser_supports_js() {
                    echo '<script>document.body.classList.remove("no-js");</script>';
            }
            add_action( 'wp_footer', 'bbpress_browser_supports_js' );
    }
    wpturk
    Participant

    This is the good part of bbpress. You don’t have hundreds of features you don’t need. As you mentioned, everything you need can be added via plugins or code customizations. (functions.php)

    Maybe, you can tell us which features you are missing? For example you can check the plugin “GD bbPress Toolbox” which adds many features to your bbpress forum.

    #234457

    In reply to: subsciption problem

    nobody
    Participant

    the problem is resolved, the problem is because code activates forum descriptions…but thank u for Replied

    #234456
    crsikes01
    Participant

    Certainly. This is the code to generate the new shortcode in functions.php or wherever your custom code is located:

    add_shortcode( 'custom_bbp-search', 'custom_bbp_search_shortcode' );
    function custom_bbp_search_shortcode( $atts ) {
    	$search_string = str_replace("-", " ", sanitize_title($_GET['bbp_search']));
            return do_shortcode( '[bbp-search search="'. $search_string .'"]' );
    }

    For the new page, just set up a new page (I called mine Forum Search with a url of /forum-search/) with the shortcode [custom_bbp-search] added.

    Finally, for the search form template, just copy wp-content/plugins/bbpress/templates/default/bbpress/form-search.php into wp-content/themes/[mythemename]/bbpress/form-search.php and replace the opening <form> line with the following:

    <form role="search" method="get" id="bbp-search-form" action="/forum-search/">

    #234454
    erich199
    Participant

    Re-posting this. For some reason my original post got marked as spam. So, this time I took out the screenshot link.

    I wanted to share some code I cooked up for one of my sites. I want to disclaimer that I’m not a professional coder but through lots of trail, error, and zero hair left I’ve found this code works very well for my website.

    There are two functions. The first one creates a “New Topic” button and uses a template hook to display it above the forum list. The second function does the same thing, but just uses a hook to display the button over the single topic display to create a “New Reply” button. The second function is basically the first function but renamed and uses a different template hook.

    These buttons, when clicked, open a modal that has the shortcode for a new topic/new reply. The code also passes the current forum id into the shortcode, so there is no need for the user to select a forum from the drop down menu. In my screenshot, I’ve enabled the WYSWYG TinyMCE editor and all buttons on it work properly. In addition, I’ve fixed it so that the user can’t accidentally close the modal. They have to physically click on the “Close” button in order to close it. I decided to do this for simplicity sake and so my users won’t accidentally click off the screen and close the modal.

    I made it because I was tired of users getting confused about the new topic/new reply topic area of bbpress. So, in order to bring it more in line with other forum software I made this code (through many trial and errors). I hope that it can help anyone in the community who’s using bbpress for their forums. Oh, I also made sure it displays nicely in mobile size screens. I added a screenshot to show people what it looks like.

    Modal Example

    
    /*
    This function adds the New Topic button to bbpress above the forum list template
    */
    
    function add_new_topic_button() {
        $forum_id = bbp_get_forum_id();
        ?>
        <button id="new-topic-button">New Topic</button>
        <div id="new-topic-modal">
            <button id="close-modal-button">Close</button>
            <div class="modal-content">
                <?php echo do_shortcode('[bbp-topic-form forum_id=' . $forum_id . ']'); ?>
            </div>
        </div>
        <script>
        jQuery(document).ready(function($) {
            var newTopicButton = $('#new-topic-button');
            var modal = $('#new-topic-modal');
            var close = $('#close-modal-button');
            newTopicButton.click(function() {
                modal.show();
                setTimeout(function() {
                    if (typeof bp !== 'undefined' && typeof bp.mentions !== 'undefined') {
                        bp.mentions.tinyMCEinit();
                    }
                }, 1000);
            });
            close.click(function() {
                modal.hide();
            });
            $('textarea#bbp_topic_content').addClass('bbp_topic_content');
        });
        </script>
        <style>
        #new-topic-modal {
            display: none;
            position: fixed;
            z-index: 999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: auto;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
            max-width: 600px;
            border-radius: 5px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        #close-modal-button {
            color: #aaaaaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            margin-right: 10px;
            margin-top: 40px;
        }
        #close-modal-button:hover,
        #close-modal-button:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
        }
        @media only screen and (max-width: 600px) {
            .modal-content {
                width: 90%;
                max-width: 90%;
            }
        }
        </style>
        <?php
    }
    add_action('bbp_template_before_single_forum', 'add_new_topic_button');
    
    
    /*
    This function adds the New Reply button to bbpress above the single topic template
    */
    
    function add_new_reply_button() {
        $forum_id = bbp_get_forum_id();
        ?>
        <button id="new-topic-button">New Topic</button>
        <div id="new-topic-modal">
            <button id="close-modal-button">Close</button>
            <div class="modal-content">
                <?php echo do_shortcode('[bbp-reply-form forum_id=' . $forum_id . ']'); ?>
            </div>
        </div>
        <script>
        jQuery(document).ready(function($) {
            var newTopicButton = $('#new-topic-button');
            var modal = $('#new-topic-modal');
            var close = $('#close-modal-button');
            newTopicButton.click(function() {
                modal.show();
                setTimeout(function() {
                    if (typeof bp !== 'undefined' && typeof bp.mentions !== 'undefined') {
                        bp.mentions.tinyMCEinit();
                    }
                }, 1000);
            });
            close.click(function() {
                modal.hide();
            });
            $('textarea#bbp_topic_content').addClass('bbp_topic_content');
        });
        </script>
        <style>
        #new-topic-modal {
            display: none;
            position: fixed;
            z-index: 999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: auto;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
            max-width: 600px;
            border-radius: 5px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        #close-modal-button {
            color: #aaaaaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            margin-right: 10px;
            margin-top: 40px;
        }
        #close-modal-button:hover,
        #close-modal-button:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
        }
        @media only screen and (max-width: 600px) {
            .modal-content {
                width: 90%;
                max-width: 90%;
            }
        }
        </style>
        <?php
    }
    add_action('bbp_template_before_single_topic', 'add_new_reply_button');
    
    
    /*
    This function calls the Buddypress js file to bbpress pages only so that @mentions can work in the modal
    */
    
    function enqueue_buddypress_js() {
        if ( function_exists( 'bp_is_active' ) && bp_is_active( 'mentions' ) ) {
            wp_enqueue_script( 'bp-mentions-js' );
        }
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_buddypress_js' );
    
    
    /* Additional Custom Forum Modal CSS This will hide the default new topic/reply form boxes but shouldn't hide the ones inside of the modal */ 
    
    .modal-content .bbp-topic-form, .modal-content .bbp-reply-form {
    	padding-top: 5px;
    	padding-bottom: 5px;
    	margin-top: 5px;
    	margin-bottom: 5px;
    }
    
    .bbpress-wrapper > .bbp-topic-form {
      display: none;
    }
    
    .modal-content .bbp-topic-form legend {
    	display: none;
    }
    
    #new-topic-button {
      float: right;
      margin-right: 10px;
    }
    
    #bbpress-forums > .bbp-reply-form {
    	display: none;
    }
    
    #234453
    webcreations907
    Participant

    You could use the below which should add your registration link to that form.

    Add to your functions.php file in your theme.

    
    if(!function_exists('dnk_add_registration_link')){
    	function dnk_add_registration_link(){
    		if( function_exists('is_bbpress') && is_bbpress() ){
    			echo '<p>Don\'t have an account? <a href="'.esc_attr( wp_registration_url() ).'">Register</a></p>';
    		}
    	}
    }
    add_action( 'login_form','dnk_add_registration_link' ,10 );
    
    
    #234451
    wpturk
    Participant

    Unfortunately, register link ist not something you can activate via settings for this part of forum.

    You need to modify this file: form-user-login.php

    Best way would be to create a bbpress direcrory in your child theme and copy this file there and modify.

    You can also make use of the [bbp-register] shortcode.

    I hope this helps.

    #234450
    dnashif
    Participant

    I think you are right. It is showing as a default wp template.

    I wish BBpress had a shortcode to add to a page for the search results. Seems logical since they have other shortcodes that it would be a no brainer for them to create one.

    Or even function code to put in my child theme functions file. I am not a developer so nothing I can do.

    Seen other people commenting about the search results page. Don’t think BBpress cares though!

    Appreciate your looking at this for me wpturk.

    You are a super hero!

    Diana

    #234444
    erich199
    Participant

    I wanted to share some code I cooked up for one of my sites. I want to disclaimer that I’m not a professional coder but through lots of trail, error, and zero hair left I’ve found this code works very well for my website.

    There are two functions. The first one creates a “New Topic” button and uses a template hook to display it above the forum list. The second function does the same thing, but just uses a hook to display the button over the single topic display to create a “New Reply” button. The second function is basically the first function but renamed and uses a different template hook.

    These buttons, when clicked, open a modal that has the shortcode for a new topic/new reply. The code also passes the current forum id into the shortcode, so there is no need for the user to select a forum from the drop down menu. In my screenshot, I’ve enabled the WYSWYG TinyMCE editor and all buttons on it work properly. In addition, I’ve fixed it so that the user can’t accidentally close the modal. They have to physically click on the “Close” button in order to close it. I decided to do this for simplicity sake and so my users won’t accidentally click off the screen and close the modal.

    I made it because I was tired of users getting confused about the new topic/new reply topic area of bbpress. So, in order to bring it more in line with other forum software I made this code (through many trial and errors). I hope that it can help anyone in the community who’s using bbpress for their forums. Oh, I also made sure it displays nicely in mobile size screens. I added a screenshot to show people what it looks like.

    https://img.iwebnow.net/screenshots/popup.jpg

     
    /*
    This function adds the New Topic button to bbpress above the forum list template
    */
    
    function add_new_topic_button() {
        $forum_id = bbp_get_forum_id();
        ?>
        <button id="new-topic-button">New Topic</button>
        <div id="new-topic-modal">
            <button id="close-modal-button">Close</button>
            <div class="modal-content">
                <?php echo do_shortcode('[bbp-topic-form forum_id=' . $forum_id . ']'); ?>
            </div>
        </div>
        <script>
        jQuery(document).ready(function($) {
            var newTopicButton = $('#new-topic-button');
            var modal = $('#new-topic-modal');
            var close = $('#close-modal-button');
            newTopicButton.click(function() {
                modal.show();
                setTimeout(function() {
                    if (typeof bp !== 'undefined' && typeof bp.mentions !== 'undefined') {
                        bp.mentions.tinyMCEinit();
                    }
                }, 1000);
            });
            close.click(function() {
                modal.hide();
            });
            $('textarea#bbp_topic_content').addClass('bbp_topic_content');
        });
        </script>
        <style>
        #new-topic-modal {
            display: none;
            position: fixed;
            z-index: 999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: auto;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
            max-width: 600px;
            border-radius: 5px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        #close-modal-button {
            color: #aaaaaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            margin-right: 10px;
            margin-top: 40px;
        }
        #close-modal-button:hover,
        #close-modal-button:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
        }
        @media only screen and (max-width: 600px) {
            .modal-content {
                width: 90%;
                max-width: 90%;
            }
        }
        </style>
        <?php
    }
    add_action('bbp_template_before_single_forum', 'add_new_topic_button');
    
    
    
    /*
    This function adds the New Reply button to bbpress above the single topic template
    */
    
    function add_new_reply_button() {
        $forum_id = bbp_get_forum_id();
        ?>
        <button id="new-topic-button">New Topic</button>
        <div id="new-topic-modal">
            <button id="close-modal-button">Close</button>
            <div class="modal-content">
                <?php echo do_shortcode('[bbp-reply-form forum_id=' . $forum_id . ']'); ?>
            </div>
        </div>
        <script>
        jQuery(document).ready(function($) {
            var newTopicButton = $('#new-topic-button');
            var modal = $('#new-topic-modal');
            var close = $('#close-modal-button');
            newTopicButton.click(function() {
                modal.show();
                setTimeout(function() {
                    if (typeof bp !== 'undefined' && typeof bp.mentions !== 'undefined') {
                        bp.mentions.tinyMCEinit();
                    }
                }, 1000);
            });
            close.click(function() {
                modal.hide();
            });
            $('textarea#bbp_topic_content').addClass('bbp_topic_content');
        });
        </script>
        <style>
        #new-topic-modal {
            display: none;
            position: fixed;
            z-index: 999;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            overflow: auto;
            background-color: rgba(0,0,0,0.6);
        }
        .modal-content {
            background-color: #fefefe;
            margin: auto;
            padding: 20px;
            border: 1px solid #888;
            width: 50%;
            max-width: 600px;
            border-radius: 5px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        #close-modal-button {
            color: #aaaaaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
            margin-right: 10px;
            margin-top: 40px;
        }
        #close-modal-button:hover,
        #close-modal-button:focus {
            color: #000;
            text-decoration: none;
            cursor: pointer;
        }
        @media only screen and (max-width: 600px) {
            .modal-content {
                width: 90%;
                max-width: 90%;
            }
        }
        </style>
        <?php
    }
    add_action('bbp_template_before_single_topic', 'add_new_reply_button');
    
    
    
    /*
    This function calls the Buddypress js file to bbpress pages only so that @mentions can work in the modal
    */
    
    function enqueue_buddypress_js() {
        if ( function_exists( 'bp_is_active' ) && bp_is_active( 'mentions' ) ) {
            wp_enqueue_script( 'bp-mentions-js' );
        }
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_buddypress_js' );
    
    
    /* Additional Custom Forum Modal CSS This will hide the default new topic/reply form boxes but shouldn't hide the ones inside of the modal */ 
    
    .modal-content .bbp-topic-form, .modal-content .bbp-reply-form {
    	padding-top: 5px;
    	padding-bottom: 5px;
    	margin-top: 5px;
    	margin-bottom: 5px;
    }
    
    .bbpress-wrapper > .bbp-topic-form {
      display: none;
    }
    
    .modal-content .bbp-topic-form legend {
    	display: none;
    }
    
    #new-topic-button {
      float: right;
      margin-right: 10px;
    }
    
    #bbpress-forums > .bbp-reply-form {
    	display: none;
    }
    
Viewing 25 results - 676 through 700 (of 32,358 total)
Skip to toolbar