Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 6,801 through 6,825 (of 32,519 total)
  • Author
    Search Results
  • #172510
    leev
    Participant

    Hello, I’m looking for a way to hide something that will be with the <?php bbp_forum_freshness_link(); ?>. Whenever there’s a topic for the forum, <?php bbp_forum_freshness_link(); ?> will display a link. If there’s no topic in the forum or it’s empty, then there will be no link. How do I add the same function to some custom added codes.

    Examples, I’m looking for something like this:

    <?php don’t display if there’s no topic or it’s empty ?>
    topic title
    by author
    <?php bbp_forum_freshness_link(); ?>

    <?php endif;?>

    #172508
    selenii
    Participant

    How can I edit this code

    	<?php if ( bbp_has_forums() ) : ?>
    
    		<?php bbp_get_template_part( 'loop',     'forums'    ); ?>
    
    	<?php else : ?>
    
    		<?php bbp_get_template_part( 'feedback', 'no-forums' ); ?>
    
    	<?php endif; ?>

    I will put forums on all forum pages, because in the subforum I have not any forums.

    #172489

    In reply to: add a specific class

    Robkk
    Moderator

    You can also use this PHP function to add a class to the forum instead of doing it manually.

    function rkk_add_forum_classes( $classes ) {
     $classes[] = 'class';
     return $classes;
    }
    add_filter( 'bbp_get_forum_class','rkk_add_forum_classes' );

    Now I would like to change while loop_forums in index forums on loop-forums.php

    I do not know exactly what you are trying to do, but for just customizing it you can put the loop-forums.php file in a child theme in a folder called bbpress and then customize the file to your liking.

    https://codex.wordpress.org/Child_Themes

    #172486
    Robkk
    Moderator

    @selenii

    1. Are you using the plugin bbPress moderation?? This plugin has a feature to confirm each topic or reply submitted by users.
    2. Do you have anything in your comment blacklist in Settings > Discussion?? bbPress uses this comment blacklist for its topics and replies and this could mark the posts as pending until approval.

    Sometimes plugins can add words to this comment blacklist, and sometimes a host can install a plugin that may have its own comment blacklist words that you may not be aware of is installed because it may be installed in the root of your site.

    Do these posts you are approving have any foul language?? Because that is usually the words in these comment blacklists.

    #172485
    stewmills
    Participant

    Unfortunately that didn’t work. I switched the code and while it still included a sidebar with stuff, it was a sidebar with all sorts of crazy stuff about a page long.

    So, I acted as if I was starting over and I copied my page.php file and resaved it as bbpress.php in my main theme folder. The result of this was a page with no sidebar anywhere in my forum since this template does not include any sidebar info.

    So do I:
    a) keep the page.php file that I renamed to bbpress.php and just add some code (I would need directions) to include the sidebar on all bbpress pages.
    b) revert back to my previous page an keep troubleshooting this issue with the page template that i know works aside from the topics page.

    Here is the code from the page.php page that I renamed to bbpress.php, which looks great but does not display my sidebar on any forum page.

    <?php get_header(); ?>
    
    <?php 
    // check for WooCommerce. If true, load WooCommerce custom layout
    if (class_exists('woocommerce') && ((is_woocommerce() == "true") || (is_checkout() == "true") || (is_cart() == "true") || (is_account_page() == "true") )){ ?>
    
    </div><!-- header-area -->
    </div><!-- end rays -->
    </div><!-- end header-holder -->
    </div><!-- end header -->
    
    <?php truethemes_before_main_hook(); //action hook ?>
    
    <div id="main" class="tt-woocommerce">
    <?php get_template_part('theme-template-part-tools-woocommerce','childtheme'); ?>
    
    <div class="main-holder">
    <div id="content">
    <?php if(have_posts()) : while(have_posts()) : the_post(); the_content(); truethemes_link_pages(); endwhile; endif; 
    comments_template('/page-comments.php', true); ?>
    </div><!-- end content -->
    
    <div id="sidebar" class="right_sidebar">
    <?php 
    		if ( (is_cart() == "true") || (is_checkout() == "true") ) {
    			dynamic_sidebar("WooCommerce - Cart + Checkout");
    		} else {
    			dynamic_sidebar("WooCommerce Sidebar");
    		}
    		?>
    </div><!-- end sidebar -->
    </div><!-- end main-holder -->
    </div><!-- main-area -->
      
      
      <?php // ELSE load default layout
      } else { ?>
      
    </div><!-- header-area -->
    </div><!-- end rays -->
    </div><!-- end header-holder -->
    </div><!-- end header -->
    
    <?php truethemes_before_main_hook();// action hook, see truethemes_framework/global/hooks.php ?>
    
    <div id="main">
    
    <?php get_template_part('theme-template-part-tools','childtheme'); ?>
    
    <div class="main-holder">
    <div id="content" class="content_full_width">
    <?php if(have_posts()) : while(have_posts()) : the_post(); the_content(); truethemes_link_pages(); endwhile; endif; 
    comments_template('/page-comments.php', true);
    get_template_part('theme-template-part-inline-editing','childtheme'); ?>
    </div><!-- end content -->
    </div><!-- end main-holder -->
    </div><!-- main-area -->
      
      
      <?php // END WooCommerce loop
      } ?>
        
    <?php get_footer(); ?>

    Thanks!

    #172484
    stewmills
    Participant

    Ok, so the code above is from your page.php file saved as bbpress.php in your theme – yes?

    NO, and that may be the issue? What I did is copy one of my other theme pages that I know included a sidebar, let’s just call it “page-with-leftsidebar.php”. I copied this page into my child folder and renamed it bbPress.php and that’s the code I posted above.

    I can gladly try your suggestion above, but could it be that I used the wrong page to create my bbPress.php file? I did install the “What The File” plugin and when I look at what page my forum points to, including new topics, they all show bbpress.php as the main page with other things listed in the Template Parts section.

    Anyhow…let me try your suggestion above with that piece of code and report back before i have you on an wild goose chase for no reason.

    Thanks!!! Will report back shortly.

    #172483
    Robin W
    Moderator

    The “blank space” where it goes is still there, it just does not display.

    Great – that was the bit of information I was after.

    Ok, so the code above is from your page.php file saved as bbpress.php in your theme – yes?

    If so then try changing

    <?php generated_dynamic_sidebar(); ?>
    

    to

    <?php get_sidebar(); ?>
    

    This may not work, I’m just guessing at how your theme is designed !

    #172481
    stewmills
    Participant

    Robin (thanks for always coming to my rescue),

    Everything on the page is good except the sidebar is missing. I can add it via dashboard if I edit the topic, but I cannot do this every time someone posts a new topic. All other pages have the sidebar.

    I tried to move my bbpress.php to the main theme directory to ensure that it was picking up this page before any other page and that changed nothing. I then thought maybe there was code in my page.php file from the initial load of bbpress that it might be looking for so I copied the page.php file from my theme and resaved it as bbpress.php and still no difference.

    I don’t really care that my forum is exactly like the layout of my other site pages so I am ok with some variation. My only requirements would be that (1) I can keep the header menu for navigation back to my main site and (2) I have the sidebar on any bbpress forum pages, specifically new topics in this situation.

    Forgive me for rambling, just trying to offer what I have tried and as well my flexibility.

    Would it be better for me to just make a new page template and tell it to pull in the sidebar on all pages versus using a template from the theme that included a sidebar?

    I am open to suggestions, but might need to be spoon fed a little to ensure I am following all of the appropriate steps.

    Many thanks!

    Pascal Casier
    Moderator

    Hi,

    Sure there is: https://codex.bbpress.org/features/reply-threading/

    Please note the bottom 2 small ‘issues’.

    Pascal.

    #172473

    In reply to: add a specific class

    neecride
    Participant

    Thank you !

    I found the file in part !!

    Now I would like to change while loop_forums in index forums on loop-forums.php

    exemple : http://gauge.wpengine.com/forums/

    i does not use shortcode I create a forum page and i edit the default page in bbpress folder on my folder template !

    translated by google !!

    #172461

    In reply to: bbp_new_forum hook

    Antipole
    Participant

    Thanks – yes – stupid error. It is always amazing what a fresh eye brings.
    Things started working then and I checked all my numerous trace actions and it is now working well. Here is the final version for your interest.

    thanks a million, Tony

    // (2)	When a new forum is created, all current users are automatically subscribed to it
    
    //	Note status of forum entry at start of any update
    function ovni_pre_post_update_status($forum_id){
    	if (bbp_is_forum($forum_id)) {
    		global $ovni_forum_old_status;
    		$ovni_forum_old_status = bbp_get_forum_visibility($forum_id);
    		}
    	}
    add_action('pre_post_update', 'ovni_pre_post_update_status');
    
    function ovni_subscribe_users_to_new_forum($forum_id){  // subscribe all users to a new forum unless it is a group forum
    	if (bbp_is_forum($forum_id)){
    		if (bbp_get_forum_parent_id( $forum_id ) == 969) return;  // if this is group forum, do nothing
    		global $ovni_forum_old_status;
    		if (in_array($ovni_forum_old_status, array(NULL, 'auto-draft', 'draft'))){
    			// forum has just been published
    			$all_user_ids = get_users();
    			foreach ($all_user_ids as $this_user){
    				bbp_add_user_forum_subscription($this_user->id, $forum_id);
    				}
    			}
    		}
    	}
    add_action('bbp_forum_attributes_metabox_save', 'ovni_subscribe_users_to_new_forum');
    
    #172457

    In reply to: bbp_new_forum hook

    Antipole
    Participant

    Thanks @fterra for your suggestions.
    I cannot see that my action on pre_post_update is firing at all, even if I edit an existing forum. I have trace actions in and neither user 33 or 32 are getting subscribed.
    Puzzled.

    function ovni_pre_post_update_status($forum_id){
    	bbp_add_user_forum_subscription(33, $forum_id);	// debug **********
    	if (bbp_is_forum($forum_id)) {
    		global $ovni_forum_old_status;
    			bbp_add_user_forum_subscription(31, $forum_id);	// debug **********
    		$ovni_forum_old_status = bbp_get_forum_visibility($forum_id);
    		}
    	}
    add_action('pre_post_update', 'ovni_pre-post_update_status');
    #172453

    In reply to: bbp_new_forum hook

    fterra
    Participant

    This would be more appropriate:

    function my_pre_post_update_hook($post_ID) {
    	if (bbp_is_forum($post_ID)) {
    		global $my_forum_old_status;
    		$my_forum_old_status = bbp_get_forum_visibility($post_ID);
    	}
    }
    add_action( 'pre_post_update', 'my_pre_post_update_hook' );
    #172452

    In reply to: bbp_new_forum hook

    fterra
    Participant

    This is funny.
    I found out that pre_post_update hook – which at first sight seemed to fire only when updating – will fire if the post (or forum) has already been auto-saved AS A DRAFT.
    Similarly I have also been surprised that “save_post_{$post->post_type}” third parameter $update will always be true after it’s first auto-saved AS A DRAFT.
    So to know if it’s a new forum (or post), I guess you have to check its previous status. For new posts the previous status will be either ‘auto-draft’, ‘draft’ or I guess it’s also possible there will be no previous status yet.

    So you can do something like hook to pre_post_update and store its current (which soon in the same request will become “previous”) status. Like this:

    function my_pre_post_update_hook($post_ID) {
    	global $my_forum_old_status;
    	$my_forum_old_status = bbp_get_forum_visibility($post_ID);
    }
    add_action( 'pre_post_update', 'my_pre_post_update_hook', 10 );

    So in your bbp_forum_attributes_metabox_save action you can check if it’s a new forum with something like:

    	global $my_forum_old_status;
    	if (in_array($my_forum_old_status, array(NULL, 'auto-draft', 'draft')))

    Warning – this condition is enough because when bbp_forum_attributes_metabox_save action is fired we know the forum’s current status will not be any of these.

    I guess you could also do it with the transition_post_status hook, whose arguments are: $new_status, $old_status, $post.

    #172447

    In reply to: vbulletin 3.x import

    Pascal Casier
    Moderator

    Hi @blandow,

    Styling can be done in a lot of ways. You can play yourself with some CSS starting from https://codex.bbpress.org/layout-and-functionality-examples-you-can-use/

    Or you can check plugins. bbP style pack might be able to help you for the background.

    Pascal.

    #172445

    In reply to: bbp_new_forum hook

    Antipole
    Participant

    @fterra – thanks for your suggestions.

    I have it working using ‘bbp_forum_attributes_metabox_save’ as you suggested but have found, perhaps not surprisingly, my function is fired on an update to the meta date. So with the code below I create a new forum and all users are subscribe; some choose to unsubscribe; I update something in the meta data and everyone is subscribed again – not good. Any idea how I can determine whether this is a first time save or an update?
    Also I do not want to auto subscribe to group forums. I have fixed this by hard-coding in the group forum’s id, but maybe there is a better way of testing whether a forum_id is a group forum?

    Any ideas welcome thanks.

    function ovni_subscribe_users_to_new_forum($forum_id){  // subscribe all users to a new forum unless it is a group forum
    	if (bbp_get_forum_parent_id( $forum_id ) == 969) return;  // if this is group forum, do nothing
    	$all_user_ids = get_users();
    	foreach ($all_user_ids as $this_user){
    		bbp_add_user_forum_subscription($this_user->id, $forum_id);
    		}
    	}
    add_action('bbp_forum_attributes_metabox_save', 'ovni_subscribe_users_to_new_forum');
    siparker
    Participant

    @casiepa
    Do you think i should just gather any info i can and assign to the trac ticket?

    The solution posted a bit further up the thread by @_az_ does the basics of removing the forum slug but as he mentioend there are a few places where the permalinks are claled like breadcrumbs etc

    From what i can find out (i am not a programmer but am trying) for a quick fix we would need to get the forum parent id from the post itself then get the slug for that forumid and any parents it has. then the post permalink is built from the parent slug and the post slug.

    This needs to hook into the permalink function to override this and there is a good example (for a different purpose) here https://github.com/korobochkin/bbpress-permalinks-with-id which i think covers off all of the different places that the changes need to be made and could possibly be used as a basis for the new plugin / code.

    I am happy to do all the testing and research if anyone is able to provide some coding experience to the mix. please just get in contact with me and i will show you everything i have found so far. then we can publish the code into the trac ticket and hopefully the main devs can put this into core.

    If anyone has any ideas on blocking issues for this also please tell me.

    I know one of the potential issues and the reason for this structure in the first place was duplicated urls. Could anyone please explain the thinking behind this. and how it might present an issue.

    I know the current topics post type wont alow duplicates so the only issue i can see would be if the forum name was the same as a topic name. Is that the only time this might happen?

    If so we would need to create a check when saving the url/permalink that a forum post type does not have the same permalink and if it does then add 1 to the end?

    The way most other forums do this is by appending the thread id into the permalink so it would appear to be /my-friendly-title-11234 for example where the post id is 11234

    not saying bbpress should do this but its an option as the id for the post is available.

    #172442
    Robin W
    Moderator

    @casiepa

    setting top to zero fixes that !

    #bbpress-forums div.bbp-topic-author img.avatar,
     #bbpress-forums div.bbp-reply-author img.avatar {
     position: relative ;
     top : 0px ;
     }
    #172440
    Robin W
    Moderator

    Whilst it needs sorting in the core product, the ticket says that putting this in the css file will fix, and did on my test site

    #bbpress-forums div.bbp-topic-author img.avatar,
    #bbpress-forums div.bbp-reply-author img.avatar {
    position: relative
    }

    https://codex.bbpress.org/functions-files-and-child-themes-explained/

    stewmills
    Participant

    I have:
    WP 4.4.2
    bbPress 2.5.8
    BuddyPress 2.4.3
    Karma theme 3.0.3

    I set-up the forum using method 2, which is a page called “userforum” containing the shortcode [bbp-forum-index] and the forum displays just fine and as well shows my left sidebar which houses my login and other widgets. I want this sidebar on ALL forum pages and by creating a bbpress.php page I think I resolved a previous issue where I couldn’t see my sidebar on all pages.

    However, I realized today that when a user creates a new Topic, the sidebar is not displayed. The only way I can make it display is to go into the topic as an WP Admin and select the desired sidebar on the Topic page settings and save changes.

    I need for new topics created by anyone to always include the sidebar. Did I miss a step somewhere or is this another aggravating quirk with bbPress or my theme not agreeing with one another

    #172431
    Robin W
    Moderator

    the code you need is

    function change_root( $args = array() ) {
    
    		// Turn off breadcrumbs
    		if ( apply_filters( 'bbp_no_breadcrumb', is_front_page() ) )
    			return;
    
    		// Define variables
    		$front_id         = $root_id                                 = 0;
    		$ancestors        = $crumbs           = $tag_data            = array();
    		$pre_root_text    = $pre_front_text   = $pre_current_text    = '';
    		$pre_include_root = $pre_include_home = $pre_include_current = true;
    
    		/** Home Text *********************************************************/
    
    		// No custom home text
    		if ( empty( $args['home_text'] ) ) {
    
    			$front_id = get_option( 'page_on_front' );
    
    			// Set home text to page title
    			if ( !empty( $front_id ) ) {
    				$pre_front_text = get_the_title( $front_id );
    
    			// Default to 'Home'
    			} else {
    				$pre_front_text = __( 'Home', 'bbpress' );
    			}
    		}
    
    		/** Root Text *********************************************************/
    
    		// No custom root text
    		if ( empty( $args['root_text'] ) ) {
    			$page = bbp_get_page_by_path( bbp_get_root_slug() );
    			if ( !empty( $page ) ) {
    				$root_id = $page->ID;
    			}
    			$pre_root_text = bbp_get_forum_archive_title();
    		}
    
    		/** Includes **********************************************************/
    
    		// Root slug is also the front page
    		if ( !empty( $front_id ) && ( $front_id === $root_id ) ) {
    			$pre_include_root = false;
    		}
    
    		// Don't show root if viewing forum archive
    		if ( bbp_is_forum_archive() ) {
    			$pre_include_root = false;
    		}
    
    		// Don't show root if viewing page in place of forum archive
    		if ( !empty( $root_id ) && ( ( is_single() || is_page() ) && ( $root_id === get_the_ID() ) ) ) {
    			$pre_include_root = false;
    		}
    
    		/** Current Text ******************************************************/
    
    		// Search page
    		if ( bbp_is_search() ) {
    			$pre_current_text = bbp_get_search_title();
    
    		// Forum archive
    		} elseif ( bbp_is_forum_archive() ) {
    			$pre_current_text = bbp_get_forum_archive_title();
    
    		// Topic archive
    		} elseif ( bbp_is_topic_archive() ) {
    			$pre_current_text = bbp_get_topic_archive_title();
    
    		// View
    		} elseif ( bbp_is_single_view() ) {
    			$pre_current_text = bbp_get_view_title();
    
    		// Single Forum
    		} elseif ( bbp_is_single_forum() ) {
    			$pre_current_text = bbp_get_forum_title();
    
    		// Single Topic
    		} elseif ( bbp_is_single_topic() ) {
    			$pre_current_text = bbp_get_topic_title();
    
    		// Single Topic
    		} elseif ( bbp_is_single_reply() ) {
    			$pre_current_text = bbp_get_reply_title();
    
    		// Topic Tag (or theme compat topic tag)
    		} elseif ( bbp_is_topic_tag() || ( get_query_var( 'bbp_topic_tag' ) && !bbp_is_topic_tag_edit() ) ) {
    
    			// Always include the tag name
    			$tag_data[] = bbp_get_topic_tag_name();
    
    			// If capable, include a link to edit the tag
    			if ( current_user_can( 'manage_topic_tags' ) ) {
    				$tag_data[] = '<a href="' . esc_url( bbp_get_topic_tag_edit_link() ) . '" class="bbp-edit-topic-tag-link">' . esc_html__( '(Edit)', 'bbpress' ) . '</a>';
    			}
    
    			// Implode the results of the tag data
    			$pre_current_text = sprintf( __( 'Topic Tag: %s', 'bbpress' ), implode( ' ', $tag_data ) );
    
    		// Edit Topic Tag
    		} elseif ( bbp_is_topic_tag_edit() ) {
    			$pre_current_text = __( 'Edit', 'bbpress' );
    
    		// Single
    		} else {
    			$pre_current_text = get_the_title();
    		}
    
    		/** Parse Args ********************************************************/
    
    		// Parse args
    		$r = bbp_parse_args( $args, array(
    
    			// HTML
    			'before'          => '<div class="bbp-breadcrumb"><p>',
    			'after'           => '</p></div>',
    
    			// Separator
    			'sep'             => is_rtl() ? __( '&lsaquo;', 'bbpress' ) : __( '&rsaquo;', 'bbpress' ),
    			'pad_sep'         => 1,
    			'sep_before'      => '<span class="bbp-breadcrumb-sep">',
    			'sep_after'       => '</span>',
    
    			// Crumbs
    			'crumb_before'    => '',
    			'crumb_after'     => '',
    
    			// Home
    			'include_home'    => $pre_include_home,
    			'home_text'       => $pre_front_text,
    
    			// Forum root
    			'include_root'    => $pre_include_root,
    			'root_text'       => $pre_root_text,
    
    			// Current
    			'include_current' => $pre_include_current,
    			'current_text'    => $pre_current_text,
    			'current_before'  => '<span class="bbp-breadcrumb-current">',
    			'current_after'   => '</span>',
    		), 'get_breadcrumb' );
    
    		/** Ancestors *********************************************************/
    
    		// Get post ancestors
    		if ( is_singular() || bbp_is_forum_edit() || bbp_is_topic_edit() || bbp_is_reply_edit() ) {
    			$ancestors = array_reverse( (array) get_post_ancestors( get_the_ID() ) );
    		}
    
    		// Do we want to include a link to home?
    		if ( !empty( $r['include_home'] ) || empty( $r['home_text'] ) ) {
    			$crumbs[] = '<a href="' . trailingslashit( home_url() ) . '" class="bbp-breadcrumb-home">' . $r['home_text'] . '</a>';
    		}
    
    		// Do we want to include a link to the forum root?
    		if ( !empty( $r['include_root'] ) || empty( $r['root_text'] ) ) {
    
    			// Page exists at root slug path, so use its permalink
    			$page = bbp_get_page_by_path( bbp_get_root_slug() );
    			if ( !empty( $page ) ) {
    				$root_url = get_permalink( $page->ID );
    
    			// Use the root slug
    			} else {
    				$root_url = get_post_type_archive_link( bbp_get_forum_post_type() );
    			}
    
    			// Add the breadcrumb
    			//$crumbs[] = '<a href="' . esc_url( $root_url ) . '" class="bbp-breadcrumb-root">' . $r['root_text'] . '</a>';
    		$crumbs[] = '<a href="/forums/">Forums</a>';
    
    		}
    
    		// Ancestors exist
    		if ( !empty( $ancestors ) ) {
    
    			// Loop through parents
    			foreach ( (array) $ancestors as $parent_id ) {
    
    				// Parents
    				$parent = get_post( $parent_id );
    
    				// Skip parent if empty or error
    				if ( empty( $parent ) || is_wp_error( $parent ) )
    					continue;
    
    				// Switch through post_type to ensure correct filters are applied
    				switch ( $parent->post_type ) {
    
    					// Forum
    					case bbp_get_forum_post_type() :
    						$crumbs[] = '<a href="' . esc_url( bbp_get_forum_permalink( $parent->ID ) ) . '" class="bbp-breadcrumb-forum">' . bbp_get_forum_title( $parent->ID ) . '</a>';
    						break;
    
    					// Topic
    					case bbp_get_topic_post_type() :
    						$crumbs[] = '<a href="' . esc_url( bbp_get_topic_permalink( $parent->ID ) ) . '" class="bbp-breadcrumb-topic">' . bbp_get_topic_title( $parent->ID ) . '</a>';
    						break;
    
    					// Reply (Note: not in most themes)
    					case bbp_get_reply_post_type() :
    						$crumbs[] = '<a href="' . esc_url( bbp_get_reply_permalink( $parent->ID ) ) . '" class="bbp-breadcrumb-reply">' . bbp_get_reply_title( $parent->ID ) . '</a>';
    						break;
    
    					// WordPress Post/Page/Other
    					default :
    						$crumbs[] = '<a href="' . esc_url( get_permalink( $parent->ID ) ) . '" class="bbp-breadcrumb-item">' . get_the_title( $parent->ID ) . '</a>';
    						break;
    				}
    			}
    
    		// Edit topic tag
    		} elseif ( bbp_is_topic_tag_edit() ) {
    			$crumbs[] = '<a href="' . esc_url( get_term_link( bbp_get_topic_tag_id(), bbp_get_topic_tag_tax_id() ) ) . '" class="bbp-breadcrumb-topic-tag">' . sprintf( __( 'Topic Tag: %s', 'bbpress' ), bbp_get_topic_tag_name() ) . '</a>';
    
    		// Search
    		} elseif ( bbp_is_search() && bbp_get_search_terms() ) {
    			$crumbs[] = '<a href="' . esc_url( bbp_get_search_url() ) . '" class="bbp-breadcrumb-search">' . esc_html__( 'Search', 'bbpress' ) . '</a>';
    		}
    
    		/** Current ***********************************************************/
    
    		// Add current page to breadcrumb
    		if ( !empty( $r['include_current'] ) || empty( $r['current_text'] ) ) {
    			$crumbs[] = $r['current_before'] . $r['current_text'] . $r['current_after'];
    		}
    
    		/** Separator *********************************************************/
    
    		// Wrap the separator in before/after before padding and filter
    		if ( ! empty( $r['sep'] ) ) {
    			$sep = $r['sep_before'] . $r['sep'] . $r['sep_after'];
    		}
    
    		// Pad the separator
    		if ( !empty( $r['pad_sep'] ) ) {
    			if ( function_exists( 'mb_strlen' ) ) {
    				$sep = str_pad( $sep, mb_strlen( $sep ) + ( (int) $r['pad_sep'] * 2 ), ' ', STR_PAD_BOTH );
    			} else {
    				$sep = str_pad( $sep, strlen( $sep ) + ( (int) $r['pad_sep'] * 2 ), ' ', STR_PAD_BOTH );
    			}
    		}
    
    		/** Finish Up *********************************************************/
    
    		// Filter the separator and breadcrumb
    		$sep    = apply_filters( 'bbp_breadcrumb_separator', $sep    );
    		$crumbs = apply_filters( 'bbp_breadcrumbs',          $crumbs );
    
    		// Build the trail
    		$trail  = !empty( $crumbs ) ? ( $r['before'] . $r['crumb_before'] . implode( $sep . $r['crumb_after'] . $r['crumb_before'] , $crumbs ) . $r['crumb_after'] . $r['after'] ) : '';
    
    		return apply_filters( 'change_root', $trail, $crumbs, $r );
    	}
    
    add_filter ('bbp_get_breadcrumb', 'change_root') ;

    pulled from a thread I did long ago

    I don’t know how code aware you are to change this to what you want, so come back and let me know – it would take me a while to work out what to change, and I really don’t want to do this if you are capable !

    #172429
    stewmills
    Participant

    Ok…I have scoured the bbPress forum and have tried several things and seem to be getting nowhere…and losing my mind at the same time.

    I have:
    WP 4.4.2
    bbPress 2.5.8
    BuddyPress 2.4.3
    Karma theme 3.0.3

    I set-up the forum using method 2, which is a page called “userforum” containing the shortcode [bbp-forum-index] and the forum displays just fine and as well shows my left sidebar which houses my login and other widgets. I want this sidebar on ALL forum pages and by creating a bbpress.php page I think I resolved the previous issue where I couldn’t see my sidebar on all pages. I should also note that my forum root slug is set to “forums”.

    So, the issue I have is that when I am on the main forum page (mysite.com/userforum) and drill down into a topic, the breadcrumb it creates is this: Forums > Forum Section > Topic. I can click on any of the breadcrumbs and get the full page with sidebar, but when I click on “Forums” in the breadcrumb it takes me to mysite.com/forums instead of mysite.com/userforum.

    Now you may tell me to change my forum root slug to “userforum” but when I do that and go back to my main forum page at mysite.com/userforum, my sidebar does not display on this page BUT the breadcrumb does not take me back to the main forum page mysite.com/userforum like I wanted.

    So, with that, what the heck am I missing? If someone can help I can get you into my actual forum page to peek under the hood. If there is simple code to add to my child functions.php file that will let me customize the URL or a simple setting I am missing somewhere?

    I have spent way too many hours trying to figure this out and I really need some help here.

    Thanks!

    #172424
    Robin W
    Moderator

    just seen this !

    https://wordpress.org/plugins/woo-login-redirect/

    if you download and unwrap it you’ll see two functions, one the filter above !

    Depending on your site it might take a

    if (is_bbpress()) $redirect = xxtype statement on line 71

    #172414
    joshcarey
    Participant

    @robin-w: The site is currently in local development. And yes, as @casiepa said, I’m not using any particular form, so I’m assuming it defaults to the standard WP login. I am using the woocommerce page and shortcode (woocommerce_my_account) for the “my account” page.


    @casiepa
    : I’ll look through those 2 resources to see if anything there helps.

    #172398
    Pascal Casier
    Moderator

    Hi,
    bbPress should be one of the easiest plugins to install, so it’s a pity to see you leave. Please remember to clean before deactivating (then of course this will not solve your issue that the site goes down, but it’s better to have a clean database): https://codex.bbpress.org/getting-started/installing-bbpress/deleting-bbpress/

    Come back anytime if you want to consider bbPress again.

    Pascal.

Viewing 25 results - 6,801 through 6,825 (of 32,519 total)
Skip to toolbar