Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 126 through 150 (of 32,294 total)
  • Author
    Search Results
  • #240388

    In reply to: Subscribe to Forum

    newtech1
    Participant

    When I inserted the customized code for all my custom fields that are created by the ACF plugin, I forgot to delete the original code that makes the subscription email notification to work. So I had that customized code and the customized code for my custom fields. Thus sending out two emails.

    I removed this code.

    
    if( function_exists( 'bbp_get_topic_post_type' ) ){
    	function newtech1_bbpress_new_topic( $post ) {
    		if( isset( $post->post_type ) && $post->post_type == bbp_get_topic_post_type() ){
    			do_action( 'bbp_new_'.bbp_get_topic_post_type(), $post->ID , $post->post_parent, [] , $post->post_author );
    		}
    	}
    	add_action(  'draft_to_publish' ,  'newtech1_bbpress_new_topic', 10 );
    }
    #240368
    farooqayubi
    Participant

    I have created a custom plugin, to do customization in BBPRESS templates, & Paid Membership Pro.. Everything other customization is working fine, But the template i want to show instead of bbpress default loop-topics.php template is not showing it /wp-content/plugins/pharmacy-membership-forum/pharmacy-membership-forum.php – Mian Plugin File /wp-content/plugins/pharmacy-membership-forum/includes/templates.php – the file where we are connecting loop-topics.php /wp-content/plugins/pharmacy-membership-forum/templates/bbpress/loop-topics.php – new template for loop-topics.php templates.php Code it appears that bbPress is not prioritizing your custom templates, or something else might be going wrong during the template loading process.

    <?php
    // Prevent direct access
    if ( ! defined( 'ABSPATH' ) ) {
        exit;
    }
    
    // Hook into plugins_loaded to ensure bbPress is loaded
    add_action('plugins_loaded', 'cmp_override_bbpress_templates');
    
    /**
     * Function to override bbPress templates.
     */
    function cmp_override_bbpress_templates() {
        // Add filter to override bbPress template parts
        add_filter('bbp_get_template_part', 'cmp_custom_template_parts', 10, 3);
    }
    
    /**
     * Filter to override bbPress templates.
     *
     * @param array  $templates Array of template paths.
     * @param string $slug      Template slug.
     * @param string $name      Template name.
     * @return array Modified array of template paths.
     */
    function cmp_custom_template_parts($templates, $slug, $name) {
        $plugin_template_path = plugin_dir_path(dirname(__FILE__)) . 'templates/bbpress/';
    
        // Check for various templates and override them
        if ($slug === 'loop' && $name === 'topics') {
            $custom_template_path = $plugin_template_path . 'loop-topics.php';
            array_unshift($templates, $custom_template_path);
            
        }
    
        if ($slug === 'content' && $name === 'single-forum') {
            $custom_template_path = $plugin_template_path . 'content-single-forum.php';
            array_unshift($templates, $custom_template_path);
        }
    
        if ($slug === 'loop' && $name === 'single-topic') {
            $custom_template_path = $plugin_template_path . 'loop-single-topic.php';
            array_unshift($templates, $custom_template_path);
        }
        
        return $templates;
        
    }
    #240367
    Robin W
    Moderator

    Still comes across as very shouty and opinionated eg ‘it’s just mind blowing’ and ‘with this blatantly obvious chronic issue’, but let me try and answer you.

    I am just a moderator here, and not a bbpress author. I don’t get paid anything to do this, and I’m just a guy sat in his kitchen trying to help others.

    So a bit of background

    bbpress was written by the founder of WordPress Matt Mullenweg as a standalone product way before mobiles/cell phones did anything more than phone and text.

    It was added as a plugin to WordPress by John James Jacoby, who has done updates to it every so often as paid work by the WordPress foundation.

    It is up to the owners of plugins as to how much work they do on their products.

    The authors tend to release updates every few years, rather than more frequently.

    My personal view is that you should consider bbpress to be a ‘mature’ product, ie any releases will be to fix issues rather than add functionality.

    bbPress is used by WordPress on their support forums, and if you look at these, you will see that they show these columns in mobile, so that is clearly how WordPress wants it to work.

    That you might decide that this is not how they should show is your opinion, and with over 100,000 installations of bbpress I have not noticed over the 10 years I have been doing support here ‘a lot’ of requests. I’m sure there have been some.

    The bbpress concept is ‘We’re keeping things as small and light as possible while still allowing for great add-on features through WordPress’s extensive plugin system.’ This does have an implicit expectation that others will either have the code and css capabilities to change bbpress to suit themselves, or hope that others have done so through plugins.

    You seem to have found some answers, and say you have found one that does this with css, and I suspect I might have answered some doing exactly this.

    I do not plan to start from scratch, so maybe if you can give me a link to ‘there’s some people that use CSS but I haven’t seen where it actually works’, then I’ll see if I can help further.

    #240364
    neofilm
    Participant

    So, more concisely put:
    Does somebody have some css I can plop in and just make these columns go away so the forum Description can spread out nice and somebody could then read it properly instead of having so much wasted real estate? Or maybe some code/function.php I can put in my Code Snippets plugin?

    #240363
    neofilm
    Participant

    A lot of people over the years have had the same problem with bb press not being responsive in that the topics, posts and last post columns are squished in mobile. Considering that the majority of people these days are using mobile devices it’s just mind blowing that this one thing has to be this chronic issue for so many people, probably most. There’s one person who has a solution that’s super complicated with like creating a directory folder… and then there’s some people that use CSS but I haven’t seen where it actually works, and so on. Is bb press ever gonna be responsive one obvious way?

    Does somebody have some css I can plop in and just make these columns go away so the forum Description can spread out nice and somebody could actually read it properly instead of having so much wasted real estate? Or maybe some function.php I can put in my Code Snippets plugin? Surely somebody has a way to do this with snippets. Bbpress is so great overall, why ruin a good thing by making it so difficult to deal with this blatantly obvious chronic issue?

    And it could just be that these are completely removed or just for mobile. But, really, completely removed would be fine and probably best.

    #240354

    In reply to: hide a specific forum

    Robin W
    Moderator
    add_filter('bbp_before_has_forums_parse_args', 'rew_hide_forums');
    
    function rew_hide_forums($args='') {
     $args['post__not_in'] = array('31867');
    return $args ;
    }

    where 31867 is the ID of the forum you want to hide, you can do multiple using array('31867', '45655') etc.

    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

    #240348

    In reply to: Subscribe to Forum

    Robin W
    Moderator

    ok, so you need to work out what is causing this by disabling your code and plugins til you work out what combination is the issue

    enkoes
    Participant

    Hi, I enable both full visual and text editors in my forum using bbp Style Pack. I found that the colour picker for text doesn’t work for every post I tested.

    To better describe the issue, pls see screenshots below:

    Before submission:
    Screenshot-1
    Screenshot-2

    After submission:
    Screenshot-3

    It seems that the html code for text colour is not sent after submission.

    Regards.

    #240322
    Robert
    Participant

    Hi
    We’re getting strange PHP Error messages relating to forum posts that don’t exist like this one. Should we be concerned?
    Many thanks
    Robert

    WordPress database error Duplicate entry ‘8702-67865’ for key ‘PRIMARY’ for query INSERT INTO ggx_gdbbx_tracker (user_id, topic_id, forum_id, reply_id, latest) VALUES (8702, ‘67865’, ‘11504’, ‘72638’, ‘2024-05-15 06:40:25’) made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), apply_filters(‘template_include’), WP_Hook->apply_filters, bbp_template_include, apply_filters(‘bbp_template_include’), WP_Hook->apply_filters, bbp_template_include_theme_compat, BBP_Shortcodes->display_topic, bbp_get_template_part, bbp_locate_template, load_template, require(‘/plugins/bbpress/templates/default/bbpress/content-single-topic.php’), do_action(‘bbp_template_after_single_topic’), WP_Hook->do_action, WP_Hook->apply_filters, Dev4Press\Plugin\GDBBX\Features\ActivityTracking->latest_users_topic, Dev4Press\Plugin\GDBBX\Database\Main->track_topic_visit, Dev4Press\v47\Core\Plugins\DBLite->__call, call_user_func_array

    #240316

    In reply to: Bulk-move topics?

    Robin W
    Moderator

    ok, so I’ve added this ability into my style pack plugin

    bbp style pack

    it is automatically there once you have activated the plugin, so just see SO TO BULK MOVE… below

    OTHERWISE IF YOU PREFER TO USE CODE then

    add_action( 'bulk_edit_custom_box',  'rew_quick_edit_fields', 10, 2 );
    
    function rew_quick_edit_fields( $column_name, $post_type ) {
    	switch( $column_name ) {
    		case 'bsp_topic_forum': {
    			echo rew_bulk_edit_forums () ;
    			break;
    		}
    		case 'bbp_topic_forum': {
    			echo rew_bulk_edit_forums () ;
    			break;
    		}
    	}
    }
    
    function rew_bulk_edit_forums () {
    	// Start an output buffer
    		ob_start();
    		
    	?>
    				<fieldset class="inline-edit-col-left">
    					<div class="inline-edit-col">
    						<p>
    							<label for="bbp_forum_id"><?php esc_html_e( 'Forum:', 'bbpress' ); ?></label><br />
    							<?php
                                                                    $no_forum_str = 
                                                                            /* translators: &mdash; is encoded long dash (-) */
                                                                            esc_html__( '&mdash; No forum &mdash;', 'bbpress' );
    								bbp_dropdown( array(
    									'show_none' => $no_forum_str,
    									'selected'  => bbp_get_form_topic_forum()
    								) );
    							?>
    						</p>
    					</div>
    				<?php
    			// Output the current buffer
    		$output =  ob_get_clean();
    	return $output ;
    }
    
    add_action( 'save_post', 'rew_bulk_edit_save' );
    
    function rew_bulk_edit_save( $post_id ){
    
    	// check bulk edit nonce
    	if ( ! wp_verify_nonce( $_REQUEST[ '_wpnonce' ], 'bulk-posts' ) ) {
    		return;
    	}
    
    	// update the forum
    	$forum_id = ! empty( $_REQUEST[ 'bbp_forum_id' ] ) ? absint( $_REQUEST[ 'bbp_forum_id' ] ) : 0;
    	remove_action( 'save_post', 'rew_bulk_edit_save' );
    
            // update the post, which calls save_post again.
            wp_update_post( array( 'ID' => $post_id, 'post_parent' => $forum_id ) );
    
            // re-hook this function.
            add_action( 'save_post', 'rew_bulk_edit_save' );
    }

    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

    SO TO BULK MOVE…

    go to dashboard>topics and use the tick boxes to the left of each topic to select the ones you want
    then above the topics use the ‘bulk actions’ to select ‘edit’
    and click ‘apply’ to the right of that

    You will the see a dropdown box labelled ‘forum’ which lets you set which forum to change those topics to,
    and click ‘update’

    Hi. So the member if he/she tries creating a group with the same name that already exists, the member is told “Group name exists, cannot make”, and stops group creation. Can you send how to implement this on buddyboss budypress? If you can also force a format type for words so no duplicates are ever made this way in input group-name ID input field, would also be great. Say you want to make a group for each flower that exists. 3 different users right now can make a group for Rose, Rse, Roseee, but these are in essence duplicates. What is the workaround here or can you send some code to help with this?

    #240302
    Robin W
    Moderator

    I’m just a guy sat in his kitchen trying to help others, I am not paid to do this.

    It is entirely relevant in that they may well be a reason why trashed posts are added, without knowing when and why the function is called and how it is used, it is impossible to say that the code is wrong.

    I agree that a filter before that or variable passed would be helpful, but bbpress is not being actively worked on at the moment so it is unlikely that this would get updated.

    If you want to flag this, raise a ticket on https://bbpress.trac.wordpress.org/

    You might want to use bbp_get_public_child_ids or use the filter at the end of the function to as you say ‘override’ the setting, or if you are using this function directly, then simply create your own version of it.

    #240299
    Chris Ostmo
    Participant

    Is that relevant? This is in custom child theme code. When I call bbp_get_all_child_ids() from code, either:
    1) I should not get ‘trash’ posts, or
    2) There needs to be a way to override post status for the query

    I haven’t traced the code through, but the ‘_bbp_total_topic_count’ post meta is getting decreased when the post is trashed. What’s visible and the count of what’s visible should definitely agree with each other.

    Chris Ostmo
    Participant

    The bbp_get_all_child_ids() function in bbpress/includes/common/functions.php is returning Trashed posts, which should objectively not be the case. There’s no world in which trashed posts should appear unless someone is intentionally digging in the trash.

    Line 1997 is currently this:
    $not_in = array( 'draft', 'future' );
    It should be this instead:
    $not_in = array( 'draft', 'future', 'trash' );

    I have tested that as a manual change, but obviously, this needs to be bbpress’ default behavior, not my locally-hacked override.

    Alternatively, you could add a third argument for overrides, but I think this is just an oversight.

    Thank you.

    #240295
    lacder32
    Blocked

    Hi there, it’s great that you’ve added your sitemap to Bing! For the ‘H1 tag missing’ notice, you might want to check your website’s template or code to ensure that it includes a proper H1 tag on all pages, including reply and topic pages.

    #240289

    In reply to: bbPress + Elementor

    jonahcoyote
    Participant

    Hi all,

    I think I have a better solution. Add the following to your themes functions.php:

    
    function make_post_type_public() {
        global $wp_post_types;
        $wp_post_types['topic']->public = true;
        $wp_post_types['topic']->show_in_nav_menus = true;
    }
    add_action('init', 'make_post_type_public');
    

    Then “Topics” will show up in your Elementor template conditions and you don’t need to mess with the other solutions which seem a little clunky. Works well for me and hope it works for others!

    #240259

    In reply to: Subscribe to Forum

    Robin W
    Moderator

    ok the code above will not help, and should be removed.

    I’d guess that because the subscription messages are being sent from ‘noreply@’ you website, your email system is rejecting this as an invalid address.

    Try installing

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Subscription Emails

    and change the address in item 1 to the email address that you are getting valid site emails from, and see if that solves.

    #240253
    Robin W
    Moderator

    great – hopefully that will fix, but I cannot see why that line of code
    should be causing a problem.

    #240240
    Robin W
    Moderator

    that line of code is related to the replies widget – as a test try disabling that widget and see if it makes a difference

    #240235

    In reply to: Subscribe to Forum

    Julianna
    Participant

    Hi

    I’m having the same issue with notifications of replies and new topics not being sent by email.

    Plugins installed:
    Simple WordPress Membership
    bbPress
    bbp style pack (notifications enabled)
    bbPress Members Only (forum set to members only with all other pages visible)
    bbPress Notify (No Spam)
    Check & log email (nothing logged in tests)
    Code Snippets (original code above added)
    Easy WP SMTP (confirmed that other emails are sending successfully, eg notification of new member registrations via Simple Membership)
    WP Notification Bell (new replies ARE showing up here)

    I’ve run tests with replies and new topics for a test user subscribed to everything (and directly to the topic used to test replies), and am still not getting any emails. Have, of course, checked the spam folder.

    I’d appreciate any suggestions for troubleshooting.

    Thank you!

    getfree
    Participant

    Hi Robin et al.,
    we are trying to start using Elementor Single Post template, but found out that “Hello theme Elementor bbpress template fix” somehow stops the template from activating (disabled all plugins, found out that now the template works and then enabled all our plugins one by one).

    Question 1: What does the plugin actually do? 🙂 I remember activating the plugin for some real need, but now it looks like the forums works just fine.

    Question 2: What could we do to get the template working (apart from deactivating a probably vital plugin mentioned earlier..). I saw one guy solving the same issue by adding a short code to a page, but at least just inserting a short code for the forum index did nothing for us.

    Our (staging) site and a Post which is affected by this https://staging11.pokerifoorumi.org/derk-van-luijk-nousi-ept-monte-carlon-paaturnauksen-voittoon/

    All our plugins are up-to date, and so is our Hello theme.

    Many thanks for the great product, as well as your help. Much appreciated.

    #240187
    Robin W
    Moderator

    Allowable codes – {site_title} {title} {author} {content} {excerpt} {url} {forum_name}

    so

    {forum_name}

    #240186
    astrologiamb
    Participant

    Hi
    I tried your plugin, what would be the code I need to write in order to get the forum title?

    New Topic Email Title
    [Academia Astrologia Avanzada MB] {title}

    The subject of the notification email
    Allowable codes – {site_title} {title}

    #240108

    In reply to: Remove BBPress Login

    Robin W
    Moderator

    use this css

    .bbp-login-form {
    	display: none !important;
    }
    #240107

    In reply to: Remove BBPress Login

    neofilm
    Participant

    Is there CSS or some code I can use in code snippet to remove it?

Viewing 25 results - 126 through 150 (of 32,294 total)
Skip to toolbar