For the current time of where the user is (so NOT where the server is), you can only do it with javascript to my knowledge. Start from this:
<script language="javascript">
ourDate = new Date();
document.write("The time and date at your computer's location is: "
+ ourDate.toLocaleString()
+ ".<br/>");
document.write("The time zone offset between local time and GMT is "
+ ourDate.getTimezoneOffset()
+ " minutes.<br/>");
document.write("The time and date (GMT) is: "
+ ourDate.toGMTString()
+ ".<br/>");
</script>
Pascal.
For the current ip, you can add this function to your child theme or have it in a plugin:
function get_the_user_ip() {
if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
//check ip from share internet
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
//to check ip is pass from proxy
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
return apply_filters( 'wpb_get_ip', $ip );
}
add_shortcode('show_ip', 'get_the_user_ip');
Then use a shortcode [show_ip] where needed
Hi. I am hoping someone can assist me with this request.
I have installed BBPress and have created forums for my site.
http://dtcdancecentral.com/DTCTest/forums/
My background is dark on every page of the site, but I want to make the forums (once you drill down into a specific forum page & topics index page & replies page) white.
The problem I am having is that these pages are not actual pages – I have no idea where they are. I thought I would find them in my pages but the only thing there is the Forum page I created and inserted the BBPress forum shortcode.
I tried using the following code in the Divi Theme options & it worked; however, it changed all my backgrounds in all my other pages that I do not want touched :
For these types of pages :
1.http://dtcdancecentral.com/DTCTest/foru … community/
2.http://dtcdancecentral.com/DTCTest/foru … ic-2-test/
/*BBPress each indiv forum background – drill down 1*/
#main-content .container {
background: #ffffff !important
}
/*BBPress each topic/reply background – drill down 2*/
#main-content {
background: #ffffff !important
}
Thanks so much for any assistance you can provide.
Hi Robin W,
Is there a way to include make these fields available to the get_available_tags function in bbpress-notify-nospam/bbpress-notify-nospam.php. Basically I’m trying to display these fields in the email notification area. Listed is the code for the get_available_tags function… Any input would be greatly appreciated. Many thanks.
public function get_available_tags( $tags='' )
{
$tags = '[blogname], [topic-title], [topic-content], [topic-excerpt], [topic-url], [topic-replyurl], [topic-author]';
$extra_tags = apply_filters( 'bbpnns_extra_topic_tags', null );
if ( $extra_tags )
$tags .= ', '. $extra_tags;
return $tags;
}
After debugging everything, set WP_Debug to false.
Here is a post explaining the bbp_setup_current_user was called incorrectly error.
bbp_setup_current_user was called incorrectly
Thanks so much! I appreciate your assistance.
I added the code to my Divi Theme customizer & it took care of the lines – 🙂
I wish I knew today how to use the page builder with BBPress. If it is not Divi – I have not learned how. Another item to research & learn.
Is there a file or code I could add that would “hide” the reply text box & create a new topic text box all together from the forum pages until a user actually clicks on “reply” or “Create a Topic”?
Do I need to create a new topic for this as it is still dealing with the “look”? If so – please let me know.
@tallsam Its not really an issue since it should show a list of items in the latest version of bbPress and since Stephen’s ticket he linked to has not been committed yet.
IF @pinkishhue’s Custom CSS code does not work after you placed it in your child themes style.css file and have also tried adding !important on the end, you can try my custom php code snippet.
Make sure to place this into your child themes functions.php file in your child theme.
// Only return one entry for revision log otherwise it gets cluttered
function bbp_trim_revision_log( $r='' ) {
$arr = array( end( $r ));
reset( $r );
return( $arr );
}
add_filter( 'bbp_get_reply_revisions', 'bbp_trim_revision_log', 20, 1 );
add_filter( 'bbp_get_topic_revisions', 'bbp_trim_revision_log', 20, 1 );
This is how you remove the line.
#main-content .container:before {
display: none !important;
}
Also I updated this bbpress.php a little more, as I do not think you will be using page builder with bbPress pages.
https://gist.github.com/robkk/f51753f1c7a5641796d8
@natinho68
Ok I see now. When you click the author link on your production site, you can see it is trying to lead to the bbPress forum profile then it just redirects to the homepage for some reason. What we need to do is try to find what is causing the redirect.
Can you do some troubleshooting to first see if you deactivate ultimate member and the bbPress addon, that the author links go to the regular bbPress forum profiles fine.
Can you also try in a default WordPress theme too to see if the same issue is present.
Troubleshooting
I cannot see the same issue you are getting with the generatepress theme and also twenty fifteen.
Did you close and sticky a topic from the WordPress backend??
Can you link to your site so I can see if this is a possible CSS issue?
When you switch to a default theme to leave it as default, do not transfer custom code snippets that you may have from one theme to it. Same thing if you have custom code snippets in a seperate plugin to try to pinpoint where the issue is present.
Since you said it turns into a draft, I guess this might be a separate plugin causing the issue.
Try some plugin troubleshooting to try to find what plugin is causing that specifically.
Troubleshooting
@tovabora
You can also use this CSS to remove the breadcrumbs if the code @casiepa gave you doesn’t remove it.
Place this CSS anywhere you can place custom CSS like in your child themes style.css file or in a seperate plugin.
div.bbp-breadcrumb {
display: none !important;
}
While browsing your forums though I did come across these common theme style issues that are conflicting with bbPress.
Add both these CSS code snippets into your child themes style.css file or in a separate custom css plugin.
This CSS should fix the gray avatar on your forum profile.
#bbpress-forums #bbp-user-avatar .avatar {
float: none;
}
This should fix the avatars looking off in your forums.
#bbpress-forums a img.alignnone {
display: inline;
margin: 0;
}
Are you talking about the bbPress login widget??
The widget has configurable fields in it to customize the register and lost password urls, and you should be able to customize the widget in the widgets section in WordPress in its respective sidebar. You can add the urls of your woocommerce registration forms too.
If your theme hardcoded it or something, you might want to contact your theme author as to how to set it up since the urls are heading to forums/register and such.
@bob1361
You can just use BuddyPress since you have that installed.
Also try to leave the plugins that you want to keep activated. There are a couple plugins that you have that have similar functionality.
Groups
bbP Private Groups
BuddyPress
Voting system
WP ULike
bbPress Votes
bbcodes/shortcodes
bbPress2 BBCode
GD bbPress tools
Unread Posts
bbPress Go To First Unread Post
bbPress New Topics
bbPress Unread Posts v2
Quotes
bbP Quotes
GD bbPress Tools
Hello,
Customizer doesn’t save correctly when WP_DEBUG is enabled and bbPress is active.
With that I mean that the save button doesn’t change state after the AJAX call has been successful. This leads to a “navigation confirmation” alert after saving when trying to navigate away from Customizer.
I haven’t tested this without enabled WP_DEBUG, but bbPress also outputs the following notice:
Notice: bbp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 2.3.) in /...../wp-includes/functions.php on line 3784
WordPress version: 4.4-beta3-35590
Theme: Twenty Sixteen 0.1.20150828
Thanks!
@katiemeeks
Does this php code snippet help any?? Make sure to place this php code snippet into your child themes functions.php file or in a plugin that can hold custom php code snippets like the functionality plugin.
//display bbPress search form above sinle topics and forums
function rk_bbp_search_form(){
if ( bbp_allow_search()) {
?>
<div class="bbp-search-form">
<?php bbp_get_template_part( 'form', 'search' ); ?>
</div>
<?php
}
}
add_action( 'bbp_template_before_single_forum', 'rk_bbp_search_form' );
add_action( 'bbp_template_before_single_topic', 'rk_bbp_search_form' );
I mean when I click on “Reply” link under your post, it should instantly paste [b]casiepa[b], into reply field, so I can mention your name in the text.
To be honest, never seen this question before. Normally you want to explain there what it is without cutting the phrase 🙂
The only way I see right now would be a jQuery like this one (50 is limit):
<script type="text/javascript">
function bbppc_cut_forum_text {
jQuery("div.bbp-forum-content").text(function(index, currentText) {
return currentText.substr(0, 50) + '...';
});
}
</script>
Then don’t forget to wp_enqueue_script to have this running.
But I have NO IDEA what the impact will be on other pages !!! And I didn’t test it either, just a quick thought.
Pascal.
Strange … Did you follow what Robin explained ?
ok, the simplest way would be
Dashboard>forums>all forums and edit each forum
put the banner in the description
then download my plugin
https://wordpress.org/plugins/bbp-style-pack/
and tick item 6 Add Forum Description on the forum display tab
Thanks, Pascal. I had tried one of those suggestions yesterday, and it “broke” my theme, so I was a little afraid to try again. However, I found the last post in the second link you posted, with the link to the Github code – that bit of code worked a treat. Thanks again.
Hi Jeroen,
If you indicate in the widget the ID of the subforum, you don’t get the recent topics of the childs of this subforum ?
If not, you will have to check the php code of the widget and play with the loop or ask for some help from a developer. But maybe somebody else has ideas here ?
Pascal.
Hi,
To remove it, add this filter in a child theme or create a plugin out of it:
add_filter( 'bbp_no_breadcrumb', '__return_true' );
If you don’t want to do it yourself, you can always install a plugin like ‘bbP Toolkit’ and set it in the options.
Pascal.
Then probably the best thing is to create a standard wordpress page, add any text/images you want and below that use the correct shortcode like [bbp-forum-index] for all forums or [bbp-single-forum id=$forum_id] for a specific forum.
Check out https://codex.bbpress.org/features/shortcodes/ for the shortcodes.
If that is not what you are looking for, get back here.
Pascal.
Thank you – I would like a text box/ content/ code. My purpose on this particular forum would be to move the content from this page: http://discoversee.com/see-readers/ above the forum.
I would like the option to have content above each forum as they all have different purposes.
I dont want them to have to click over to that forum to know what the purpose of the forum is. Also to provide some text and direction on posting for organization.
Hello! I have install plugin bbPress. And after that at the top of the every page of site I have see breadcrumbs.
Help please! How to deactivate it? Maybe some php code to delete?
Forum link:
Форум туристический обстоятельный