ok, so your topic and reply forms will have pages with urls, so you just need to put the buttons where you want
<input type="button" value="button name" onclick="window.open('http://www.website.com/page')" />
Hi, Robin,
I’ve seen a number of posts about this but can’t find a specific solution. I’d like my login to call out to the page I created with the bbpress shortcode: https://museum-hub.org/forum-login/ vs. the generic WP login page. Within your style pack, I’ve gone to the Login tab and added that page where it says “Login Page: You should create a wordpress page with a login shortcode such as [bbp-login] and put the full url in here e.g. http://www.mysite.com/loginpage. If left blank the default wordpress login page will be used.” I’ve saved it, of course. I’ve done the same thing with the “Register” field, sending people here: https://museum-hub.org/register/. Any thoughts on to bypass the WP default login? I’m trying to keep folks from seeing any WP dashboards, etc.
THANK YOU!
Basically, instead of having the create topic / topic reply form on the same page as the thread I want to create a button that links to a secondary page. I know this is possible with shortcodes, but is there a way of doing this without shortcodes? So that BBP auto-generates the page itself?
I know you can use shortcodes to add forms (such as new topic, login, new reply etc) to dedicated pages, but is there a fucntion or hook I can use to simply get BBP to automatically generate a new form page?
oops semi colon missing from $image = line
<?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>
<?php
$image_id = get_user_meta (bbp_get_reply_author_id(), 'profile-picture' , true) ;
$image = get_post_meta ($image_id, _wp_attached_file, true) ;
echo '<li>herestart'.$image.'hereend</li>' ;
?>
Dont worry I have just found the solution myself!
Here it is for anyone who has the same issue:
div.bbp-forum-header, div.bbp-reply-header, div.bbp-topic-header {
padding: 0px;
}
Hi I would like to change this CSS code:
.bbp-forum-header, .bbp-reply-header, .bbp-topic-header {
clear: both;
overflow: hidden;
padding: 8px 10px 8px 130px;
margin-bottom: 0;
border-width: 1px 0 0;
border-color: #e6e6e6;
border-color: var(--g1-border-color);
}
to have its padding set to 0px.
I have tried adding this to my style.css file in my child theme but it didn’t work:
.bbp-forum-header, .bbp-reply-header, .bbp-topic-header {
padding: 0px;
}
I am new to CSS so I’m not sure if that code above should overwrite the default styling? I assume not as it isn’t working!
Many thanks!
ok, so we are making progress.
I don’t expect this to work, just to return the next stage
so amend that to
<?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>
<?php
$image_id = get_user_meta (bbp_get_reply_author_id(), 'profile-picture' , true) ;
$image = get_post_meta ($image_id, _wp_attached_file, true)
echo '<li>herestart'.$image.'hereend</li>' ;
?>
ok, can you change the other one to
<?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>
<?php
$avatar = get_user_meta (bbp_get_reply_author_id(), 'profile-picture' , true) ;
echo '<li>herestart'.$avatar.'hereend</li>' ;
?>
try
<?php
$neighborhood = get_user_meta (bbp_get_reply_author_id(), 'user-subdivision' , true) ;
echo '<li>'.$neighborhood.'</li>' ;
?>
come back if that doesn’t work
for the avatar, I need to know what is stored in the usermeta, so can you try adding this after line 44
<?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>
to get
<?php bbp_reply_author_link( array( 'show_role' => true ) ); ?>
<?php
$avatar = get_user_meta (get_current_user_id(), 'profile-picture' , true) ;
echo '<li>'.$avatar.'</li>' ;
?>
I need to see if this produces a url or link to media item etc.
ok replace the
<?php echo 'hello' ; ?>
with
<?php
$neighborhood = get_user_meta (get_current_user_id(), 'user-subdivision' , true) ;
echo '<li>'.$neighborhood.'</li>' ;
?>
and let’s see if that does that one first
so we need to work out which theme template is rendering the forum pages
looking at the page you gave me, I see that the template has a div of
<div id="content-area" class="clearfix">
This is probably a common div to several files, but we can use it’s presence to track down the file
so you need to look in your theme (wp-content/themes/%your-theme-name%) for likely files
If you have notepad++ (or another text editor that will do this) you can download your theme to your computer and do a search across all the files.
otherwise you might have files called page.php, single.php, content.php, content-page.php etc.
in each file where you find the <div id="content-area" then add a further class, but call each one something different
eg
<div id="content-area myclass1" class="clearfix">
<div id="content-area myclass2" class="clearfix">
etc.
then use the browser inspector and hopefully you’ll find the class repeated in there which will tell you what template it is using
then come back
great, so now I need to know the names of the fields you want in the database
so I need to construct a bit of code that looks like
$neighborhood = get_user_meta ($user_id, ‘%what_the_field_is_called%’ , true) ;
so I need %what_the_field_is_called% for both field 🙂
Thanks for the quick reply.
I used to mod forums and CMS’s before WP existed and have not done much since… so I ‘get it’ but don’t know enough to just whip up a bunch of code. haven’t touched PHP but can get through HTML. Would editing the file not also change the layout etc of other pages within the theme or is the forum using something dedicated to it and it only? Essentially, I need to make the forum look like an existing site and change the header at minimum.
bbpress will render pages using a .php file – this can be one of many in your theme.
It is this file that you will need to edit and put in a child theme to get what you want.
so how familiar with files, FTP and code are you ?
find
wp-content/plugins/bbpress/templates/default/bbpress/loop-single-reply.php
transfer this to your pc and edit
before line 56 which says
<?php do_action( 'bbp_theme_after_reply_author_details' ); ?>
add the following
<?php echo 'hello' ; ?>
and save
create a directory on your theme called ‘bbpress’
ie wp-content/themes/%your-theme-name%/bbpress
where %your-theme-name% is the name of your theme
Then transfer the file you saved above and put in in the directory called bbpress that you created above, so you end up with
wp-content/themes/%your-theme-name%/bbpress/loop-single-reply.php
bbPress will now use this template instead of the original
You should now see ‘hello’ where you want the neighborhood field
If you get this far, then come back
ok, try this
add_filter( 'gettext', 'rew_change_text', 20, 3 );
//This function changes the text wherever it is quoted
function rew_change_text( $translated_text, $text, $domain ) {
if ( $text == 'Subscribe' ) {
$translated_text = 'Watch';
}
if ( $text == 'Unsubscribe' ) {
$translated_text = 'Unwatch';
}
return $translated_text;
}
Thanks, the code works however only when loading onto the page. When I click to either ‘Watch’ or ‘Unwatch’ the text reverts back to ‘Unsubscribe’ or ‘Subscribe’ until I refresh the page again.
untested, but this should work
add_filter ('bbp_before_get_topic_subscribe_link_parse_args' , 'change_subscribe') ;
function change_subscribe ($args) {
$args['subscribe'] = 'Watch' ;
$args['unsubscribe'] = 'Unwatch' ;
return $args ;
}
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
Hi,
is there a way to change the text of the subscription button? Currently it says ‘Subscribe’ and ‘Unsubscribe’ and I would like to change to ‘Watch’ and ‘Unwatch’ respectively. I believe the code that can change this is within the file \bbpress\includes\topics\template.php lines 1781 and 1782. I could change them in here but I would rather change them via my child theme if this is possible?
Thanks!
try
#post-2399 .bbp-breadcrumb {
display: none;
}
AS far as I know this forum just uses the default.
There are no problems I know of in not using the prefix unless you have other plugins that use ‘topic’ and ‘reply’ as part of their permalinks.
So it is a matter of personal choice.
In my opinion, only site owners worry about what the url is !! When I am on any other site, I rarely look at the url, and if I am on say Amazon as I was a moment ago it looked like
https://www.amazon.co.uk/?ie=UTF8&tag=googhydr-21&hvadid=208892259274&hvpos=&hvexid=&hvnetw=g&hvrand=3531407930769062293&hvpone=&hvptwo=&hvqmt=b&hvdev=c&ref=pd_sl_9djqxtzprt_e
🙂 🙂 🙂
Where do I set it to allow shortcodes to show inside bbpress posts?