Community Forums › Forums › Archived Forums › General Discussion › Using "excerpt" AND bbpress create unexpected behaviors (search result page)
Tagged: archives, bbPress, entry excerpt
- This topic has 6 replies, 2 voices, and was last updated 7 years, 5 months ago by jimmyjames.
-
AuthorPosts
-
July 5, 2017 at 10:51 am #208706jimmyjamesMember
Here are some interesting quirks I've been finding with Genesis + BBpress
- Creating a "page" + using bbpress shortcode for forums. Genesis ignores the page and uses the archive template
- If (in genesis settings) you set archive pages to show "excepts", bbpress archive turns into a weird sort of search result page and makes me sad
My goal is to have bbpress archives and topics show as they should AND to use excerpts for my blog posts (not show the whole post on blog archive pages)
Do I need to create a second "archive.php" or something that the genesis setting ignores, and bbpress hooks into?
Is there a solution by using the "more tag" or something?
Here's my testing site
July 5, 2017 at 4:07 pm #208728Victor FontModeratorI am not seeing what you describe. Please provide specific examples.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?July 5, 2017 at 5:16 pm #208732jimmyjamesMemberSorry, I actually still had it set to "entry content" in genesis settings.
So...
This displays forums normally BUT blog post archives show full post. Genesis --> settings
This setting makes blog posts show excerpt, but bbpress now is pulling an excerpt instead of showing the forum archive:
This is what it looks like now:
And a tag archive page:
I have found this consistently with several genesis themes, where the forum and blog "archives" are connecting somehow in the settings.
single forum and single topic behave as expected.
Here's the forum pageJuly 6, 2017 at 5:34 am #208764Victor FontModeratorI'm not that familiar with BBPress, but if you want to return BBPress to display full content and leave Genesis displaying one of the truncated content displays, you have to create a conditional in your functions.php. BBPress has built-in conditional functions to help with this task. Here's some code that might work. I don't have BBPress installed anywhere, so this is untested, but it should get you started down the right path:
if ( bbp_is_forum_archive() ) { remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); remove_action( 'genesis_post_content', 'genesis_do_post_content' ); remove_action( 'genesis_entry_content', 'bbpress_do_post_content' ); remove_action( 'genesis_post_content', 'bbpress_do_post_content' ); } function bbpress_do_post_content() { if ( is_singular() ) { the_content(); if ( is_single() && 'open' === get_option( 'default_ping_status' ) && post_type_supports( get_post_type(), 'trackbacks' ) ) { echo '<!--'; trackback_rdf(); echo '-->' . "\n"; } if ( is_page() && apply_filters( 'genesis_edit_post_link', true ) ) { edit_post_link( __( '(Edit)', 'genesis' ), '', '' ); } } else { the_content( genesis_a11y_more_link( __( '[Read more...]', 'genesis' ) ) ); } }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?July 6, 2017 at 2:03 pm #208791jimmyjamesMemberThanks for having a look, unfortunately the code did nothing as far as I could see. There's a decent plugin (hasn't been updated in over 2 years though) that works for this, bbpress-genesis-extend I was just trying to accomplish without adding more plugins, and to figure out what was going on.
I THINK it has to do with this:
BBpress calls your themes templates, and you can customize them: https://codex.bbpress.org/themes/theme-compatibility/The problem is (I think), for "forum archives", is that genesis handles them a little differently than other themes. So, if I create a page (eg community-forums) and paste the bb short code [bbp-forum-index], look ma, it works! I navigate to mysite.com/community-forums and I see a page with the bbpress archives.
IF I then (in bb settings) use community-forums as my base slug, genesis and bbpress ignore that I created a page. They think, "hey, this is an archive page! Genesis has page_archive.php, let's use that!" however bbpress relies heavily on the_content so it's trying to work it's magic within an excert.
So, out of the box, I can:
A) In genesis setting >> archives "show full content" ...it works!
B) Use a page I've created and choose a different forum root (however now slugs and bread crumb trail leads me back to the "broken" archive)
C) Use the magical plugin mentioned aboveDue to time smashing my head against the computer on this, I will probably stick with the plugin, but I must say this has been BUGGING ME 🙂
If you have any other ideas, I'd be happy to try them, otherwise I thank you kindly for your time and I'll mark it resolved.
July 6, 2017 at 3:00 pm #208792Victor FontModeratorThe Genesis page_archive.php displays a sitemap, not a list of posts.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?July 6, 2017 at 4:44 pm #208796jimmyjamesMemberWhat I meant was it's calling the list of posts not the page content nor displaying the bbpress content. Thank you for correcting me.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.