not quite sure what you last sentence means, but in essence if
dashboard>settings>forums>forum root slug>forum root equals ‘forums’, then create a page with the permalink of ‘forums’ and put
[bbp-forum-index]
in it. You can then do your seo on that page
If you are using yoast seo, you may want to add this plugin as well – I haven’t yet looked at it, but seems to do some seo stuff on topics etc.
BBpress Addon For Yoast SEO
user will get forum access as per
dashboard>settings>forums>auto role – you can change this to blocked if you don’t want automatic access.
The rest of your request would require some bespoke code, which is well beyond any free help I’m afraid.
On the forums index under Last Post I have:
“Title Of the Thread That Was Updated Most Recently”
“17 hours, 11 minutes ago”
I am wanting to put the two on a single line.
eg. “Title of the Thread (7 hours, 11 minutes ago)”
The area of the loop-single-forum file is as follows:
<li class="bbp-forum-freshness">
<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
<?php bbp_forum_freshness_link(); ?>
<?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>
<p class="bbp-topic-meta">
<?php do_action( 'bbp_theme_before_topic_author' ); ?>
<span class="bbp-topic-freshness-author"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'size' => 14 ) ); ?></span>
<?php do_action( 'bbp_theme_after_topic_author' ); ?>
</p>
</li>
I’ve tried editing this quite a bit but all attempts have failed. Any tips or feedback on how I can display the Thread Title (time posted) on a single line would be greatly appreciated.
Thank you!
Thanks, Robin. I think I’m using a few of your plugins as well. 🙂
The way I approached this plugin is that it’s only use is to print the url of the user profile. As you can see, no surrounding a tag and no anchor text. That means you can put it anywhere inside of your own links, which is probably even easier than trying to specify that with a shortcode attribute.
So, if the logged in/logged out part were added, it would still break, just in a different way. 🙂
The idea is that, if you need to check for logged in/logged out status, you probably need to do it for multiple elements of your site. In that case, a separate plugin that does that is more useful and will work in harmony with this one.
Anyway, that was my thought process. Happy to hear other thoughts.
I started with something very simple, so know the amount of work to publish a plugin and understand all the processes to that point – congratulations !!
you can fix the broken part by only executing if the user is logged in eg
change
function bbp_profile_link_shortcode() {
$link = bbp_get_user_profile_url( bbp_get_current_user_id() ) ;
return $link;
}
to
function bbp_profile_link_shortcode() {
if (!is_user_logged_in()) return ;
$link = bbp_get_user_profile_url( bbp_get_current_user_id() ) ;
return $link;
}
This makes the function not display if the user isn’t logged in
use this in your functions file and change the address to what you want
add_filter('bbp_get_do_not_reply_address','my_bbp_no_reply_email');
function no_reply_email(){
$email = 'noreply@yourdomain.com'; // any email you want
return $email;
}
you can change that default to email address as well with :
add_filter('bbp_subscription_to_email','my_bbp_subscription_to_email');
function my_bbp_subscription_to_email(){
$email = 'noreply@yourdomain.com'; // any email you want
return $email;
}
just loaded that plugin to my test site, and with auto-embed on it works fine.
This
<p>https://photos.app.goo.gl/pOeSirvJb5oC7kFC2</p>
displays the embed just fine.
So all we now need to do is work out the difference between my test site and your staging site !!
When you’ve come back on the Q’s above, I’ll do some more digging.
untested by this should work
//change topic order
add_filter('bbp_before_has_topics_parse_args', 'rew_topic_order_by_meta');
function rew_topic_order_by_meta ($args) {
$args['meta_key'] = 'put_meta_key_here' ;
$args['orderby'] = 'meta_value' ;
$args['order'] = 'DESC' ; //or ASC if needed
return $args ;
}
just put your meta_key where it says
Hi @brent0r
I made the following adjustment in my child-theme´s loop-single-forum.php and styled with CSS.
This code will place all elements in the right order to have simple CSS adjustments make it all work as expected.
<?php
/**
* Forums Loop - Single Forum
*
* @package bbPress
* Theme OrganicSquare
* Child-theme of TwentySixteen
*/
?>
<ul id="bbp-forum-<?php bbp_forum_id(); ?>" <?php bbp_forum_class(); ?>>
<li class="bbp-forum-info">
<div class="forumtitle">
<?php do_action( 'bbp_theme_before_forum_title' ); ?>
<a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>" title="<?php bbp_forum_title(); ?>"><?php bbp_forum_title(); ?></a>
<?php do_action( 'bbp_theme_after_forum_title' ); ?>
<?php do_action( 'bbp_theme_before_forum_sub_forums' ); ?>
<div class="bbp-forum-content"><?php bbp_forum_content(); ?></div>
<?php do_action( 'bbp_theme_after_forum_sub_forums' ); ?>
<?php do_action( 'bbp_theme_before_forum_description' ); ?>
<?php do_action( 'bbp_theme_after_forum_description' ); ?>
<?php bbp_forum_row_actions(); ?></div>
</li>
<li class="bbp-forum-topic-count">
<div class="topic-reply-counts">Topics: <span class="ismcounter"><?php bbp_forum_topic_count(); ?></span></div>
<div class="topic-reply-counts">Posts: <span class="ismcounter"><?php bbp_show_lead_topic() ? bbp_forum_reply_count() : bbp_forum_post_count(); ?></span></div>
</li>
<li class="bbp-topic-freshness mob-hide-link-forum">
<?php do_action( 'bbp_theme_before_forum_freshness_link' ); ?>
<div class="freshness-author"><span class="fresh-avatar"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'type' => 'avatar', 'size' => '40' ) ); ?></span>
<div class="fresh"><h2><a href=" <?php bbp_forum_last_reply_url(); ?>" class="forumpostlink"><?php bbp_forum_last_reply_title(); ?></a></h2>
<span class="forumlist-name"><?php bbp_author_link( array( 'post_id' => bbp_get_forum_last_active_id(), 'type' => 'name' ) ); ?></span>
<span class="widgetlistdate"><?php bbp_forum_freshness_link(); ?></span></div>
<?php do_action( 'bbp_theme_after_forum_freshness_link' ); ?>
</div>
</li>
</ul><!-- #bbp-forum-<?php bbp_forum_id(); ?> -->
you have total height constrained by
#bbpress-forums li.bbp-body ul.forum {
border-top: 0;
height: 90px;
}
so
#bbpress-forums li.bbp-body ul.forum {
height: auto !important;
}
Line 4255 of your theme Pixiehuge has
#bbpress-forums li.bbp-body ul.forum li {
height: 100%;
display: flex;
display: -webkit-flex;
flex-direction: column;
-webkit-flex-direction: column;
justify-content: center;
-webkit-justify-content: center;
}
The height : 100% is the issue
You need to put
#bbpress-forums li.bbp-body ul.forum li {
height: auto;
}
or
#bbpress-forums li.bbp-body ul.forum li {
height: auto !important;
}
(Try without the !important first)
into your theme’s custom css, or the custom css part of my bbp style pack plugin
you can simply filter this in your theme’s function file.
not tested but
add_filter( 'bbp_number_format', 'rew_number_format', 10 , 5) ;
function rew_number_format ($number_format, $number, $decimals, $dec_point, $thousands_sep) {
$thousands_sep = '' ;
return apply_filters( 'rew_number_format', number_format( $number, $decimals, $dec_point, $thousands_sep ), $number, $decimals, $dec_point, $thousands_sep );
}
I’ve fixed that in the style pack plugin with version 3.7.2
for anyone using the function above it should read
function rew_forum_order_by_freshness ($args) {
$args['meta_key'] = '_bbp_last_active_time' ;
$args['orderby'] = 'meta_value' ;
$args['order'] = 'DESC' ;
return $args ;
}
add_filter('bbp_before_has_forums_parse_args', 'rew_forum_order_by_freshness');
which just changes the order, rather than the previous function which overwrites all the parameters submitted by subscriptions
it’s caused by
#bbpress-forums .reply {
margin-left: 0 !important;
width: auto !important;
}
which says it is inline code.
The width: auto !important needs to be width :100% !important.
Auto makes it only as wide as it needs to be, so for short sentences it truncates.
But I’m also getting an error saying that your “sydney-child-theme/style.css could not be loaded”
I was able to edit the style.css to get what I was looking for. Line 207. Compare and change.
code,
kbd,
tt,
var,
samp,
pre {
font-family: monospace, serif;
font-size: 10px;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
line-height: 1.6;
}
code,
pre {
border: 1px solid rgba(0, 0, 0, 0.1);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin-bottom: 24px;
max-width: 100%;
overflow: auto;
padding: 12px;
white-space: pre;
white-space: pre-wrap;
word-wrap: break-word;
}
This is the code
function bp_redirect($user)
$redirect_url = "";
if (defined('ICL_LANGUAGE_CODE')) {
switch (ICL_LANGUAGE_CODE) {
case 'fr':
$redirect_url = "https://volunteerteacher.org/fr/enregistrement-avec-succes/";
break;
default:
$redirect_url = 'https://volunteerteacher.org/registration-successful/"';
break;
}
bp_core_redirect($redirect_url);
}
return $redirect_url;
}
add_action('bp_core_signup_user', 'bp_redirect', 100, 1);
Hello,
I have a issue, I want to have a code who works like this:
If user registered on English version – redirect to custom English registered successfully page
If user registered on French version – redirect to custom French registered successfully page
So far I have made this below:
function bp_redirect($user)
$redirect_url = “”;
if (defined(‘ICL_LANGUAGE_CODE’)) {
switch (ICL_LANGUAGE_CODE) {
case ‘fr’:
$redirect_url = “https://mysite.com/fr/enregistrement-avec-succes/”;
break;
default:
$redirect_url = ‘https://mysite.com/registration-successful/”‘;
break;
}
bp_core_redirect($redirect_url);
}
return $redirect_url;
}
add_action(‘bp_core_signup_user’, ‘bp_redirect’, 100, 1);
Unfortunately it is not working and I do not know what do do more to make it work.
Language plugin is WPML the language pages are http://www.mysite.com/fr , http://www.mysite.com/es etc,
Please help me, I really need this script to be working.
Thank you so much
The use of actual [code][/code] tags that everyone is familiar with. Smaller font or font size option for the code tags. Word wrap for the code tags.
Thanks!
I finally figured it out. No need to use the “Full Page Width” option or any other techniques found about the web. If you installed a bbPress forum and everything is set to its defaults. Just use the following…
Select “Customize”
Select “Additional CSS”
Add/Paste the following…
.bbpress #content-sidebar {
display: none;
}
#bbpress-forums {
margin-left: auto !important;
margin-right: auto !important;
width: 170% !important;
}
Forum link in first post is incorrect now. A redirect is being setup though as that is my old link to another forum I use to use. New forum link is, http://www.posemotion.com/forums
@aksteve – I had the same frustration. Try this simple plugin I just created. It’ll print the profile url via a shortcode so you can insert it anywhere you like.
@sarwarc – I just created this very simple plugin to give you access to the user profile link via a shortcode. You can use it in conjunction with the Shortcodes in Menus plugin to add a link to the user’s profile page in your menu.
Glad you got it figured out. I just created this very simple plugin to print the profile url via shortcode in case you find it useful
I have also created a very simple plugin to give you access to the user profile url.
I just created this plugin. I think it will do exactly what you’re trying to achieve.
I’ll start by saying I have no idea what I’m doing and I can barely write php better than a toddler.
I noticed that people have been asking for this (or something very similar to this) for years and it still isn’t part of core and no one’s written a plugin for it. I needed to figure it out on my own, so thought I’d finally make an attempt to contribute back to a platform that has given me so much.
bbPress Profile Link Shortcode
It doesn’t do anything fancy, but it does what it says. Hope you find it helpful!