Forum Replies Created
-
Okay cool, thank you Iook forward to seeing it,
Yep using bp 1.5
In future if anyone gets this issue, It was an issue with AJAX, I had to add this to my functions
require(‘ajax.php’);
Change the bit inside the inverted commas to the _inc/ajax.php if that is where it is
Look into global.js on your site, the same issue happened to mine.
Yes its possible you need to add some code to the bp-custom.php which should be in your plugins.
I’m not sure the exact code for removing them two as they are in the sub menu try these links:
http://themekraft.com/customize-profile-and-group-menus-in-buddypress/
Hi, If its the problem I had then your website is not loading Global.JS you need to backup your functions.php file, (use your childthemes one if you have one) then edit it and add this code below near the bottom:
if ( !function_exists( ‘bp_dtheme_enqueue_scripts’ ) ) :
/**
* Enqueue theme javascript safely
*
* @see https://codex.wordpress.org/Function_Reference/wp_enqueue_script
* @since 1.5
*/
function bp_dtheme_enqueue_scripts() {
// Bump this when changes are made to bust cache
$version = ’20110921?;// Enqueue the global JS – Ajax will not work without it
wp_enqueue_script( ‘dtheme-ajax-js’, WP_PLUGIN_DIR . ‘/buddypress/bp-themes/bp-default/_inc/global.js’, array( ‘jquery’ ), $version );// Add words that we need to use in JS to the end of the page so they can be translated and still used.
$params = array(
‘my_favs’ => __( ‘My Favorites’, ‘buddypress’ ),
‘accepted’ => __( ‘Accepted’, ‘buddypress’ ),
‘rejected’ => __( ‘Rejected’, ‘buddypress’ ),
‘show_all_comments’ => __( ‘Show all comments for this thread’, ‘buddypress’ ),
‘show_all’ => __( ‘Show all’, ‘buddypress’ ),
‘comments’ => __( ‘comments’, ‘buddypress’ ),
‘close’ => __( ‘Close’, ‘buddypress’ ),
‘view’ => __( ‘View’, ‘buddypress’ )
);wp_localize_script( ‘dtheme-ajax-js’, ‘BP_DTheme’, $params );
}
add_action( ‘wp_enqueue_scripts’, ‘bp_dtheme_enqueue_scripts’ );
endif;Sure, if i understand correctly you only want logged in users to see certain pages.
Private-buddypress should do the job:
https://wordpress.org/extend/plugins/private-buddypress/Hope that helps.
Thank you so much.
If anyone in the future gets this issue, my theme is Arras, the childtheme is called BrownBuddy and you have to edit the above code on the functions.php which is located in the BrownBuddy theme’s root.
Thank you both for that, it directed me in the right direction… I removed the wp_plugins_dir to the full link and now it works.
Once again thank you
I know I added this code here:
if ( !function_exists( ‘bp_dtheme_enqueue_scripts’ ) ) :
/**
* Enqueue theme javascript safely
*
* @see https://codex.wordpress.org/Function_Reference/wp_enqueue_script
* @since 1.5
*/
function bp_dtheme_enqueue_scripts() {
// Bump this when changes are made to bust cache
$version = ‘20110921’;// Enqueue the global JS – Ajax will not work without it
wp_enqueue_script( ‘dtheme-ajax-js’, WP_PLUGINS_DIR . ‘/buddypress/bp-themes/bp-default/_inc/global.js’, array( ‘jquery’ ), $version );// Add words that we need to use in JS to the end of the page so they can be translated and still used.
$params = array(
‘my_favs’ => __( ‘My Favorites’, ‘buddypress’ ),
‘accepted’ => __( ‘Accepted’, ‘buddypress’ ),
‘rejected’ => __( ‘Rejected’, ‘buddypress’ ),
‘show_all_comments’ => __( ‘Show all comments for this thread’, ‘buddypress’ ),
‘show_all’ => __( ‘Show all’, ‘buddypress’ ),
‘comments’ => __( ‘comments’, ‘buddypress’ ),
‘close’ => __( ‘Close’, ‘buddypress’ ),
‘view’ => __( ‘View’, ‘buddypress’ )
);wp_localize_script( ‘dtheme-ajax-js’, ‘BP_DTheme’, $params );
}
add_action( ‘wp_enqueue_scripts’, ‘bp_dtheme_enqueue_scripts’ );
endif;I put this in the last section of functions.php
Thanks for getting back,
Nope the wp-CONTENTfile is still there, and all in the correct place buddypress is ROOT>WP-CONTENT>PLUGINS>BUDDYPRESS and the themes are also the same
Hi it does not appear to have worked, I put it in the child theme currently in use and the main theme. Below is my functions.php with the code in it, does that seem correct?
<?php
add_action( ‘widgets_init’, ‘bptc_login_out_widget’ );function bptc_login_out_widget() {
register_widget( ‘BP_Theme_Converts_LogIn_Box’ );
}
class BP_Theme_Converts_LogIn_Box extends WP_Widget {/**
* Widget setup.
*/
function BP_Theme_Converts_LogIn_Box() {
/* Widget settings. */
$widget_ops = array( ‘classname’ => ‘bptc-login-out’, ‘description’ => __(‘BuddyPress Log In/Out Widget.’, ‘bptc-login-out’) );/* Widget control settings. */
$control_ops = array( ‘width’ => 300, ‘height’ => 350, ‘id_base’ => ‘bptc-login-out-widget’ );/* Create the widget. */
$this->WP_Widget( ‘bptc-login-out-widget’, __(‘BuddyPress Log in/out widget’, ‘bptc-login-out’), $widget_ops, $control_ops );
}/**
* How to display the widget on the screen.
*/
function widget( $args, $instance ) {
extract( $args );/* Before widget (defined by themes). */
echo $before_widget;buddyPressLoginBox();
/* After widget (defined by themes). */
echo $after_widget;
}}
function buddyPressLoginBox() {
?><a href="”><a class="button logout" href="”>
<?php printf( __( ' You can also create an account.’, ‘buddypress’ ), site_url( BP_REGISTER_SLUG . ‘/’ ) ) ?>
<form name="login-form" id="sidebar-login-form" class="standard-form" action="” method=”post”>
<input type="text" name="log" id="sidebar-user-login" class="input" value="” />
<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="” tabindex=”100″ />
<?php /* Show forum tags on the forums directory */
if ( BP_FORUMS_SLUG == bp_current_component() && bp_is_directory() ) : ?><?php
}
if ( !function_exists( ‘bp_dtheme_enqueue_scripts’ ) ) :
/**
* Enqueue theme javascript safely
*
* @see https://codex.wordpress.org/Function_Reference/wp_enqueue_script
* @since 1.5
*/
function bp_dtheme_enqueue_scripts() {
// Bump this when changes are made to bust cache
$version = ‘20110921’;// Enqueue the global JS – Ajax will not work without it
wp_enqueue_script( ‘dtheme-ajax-js’, WP_PLUGINS_DIR . ‘/buddypress/bp-themes/bp-default/_inc/global.js’, array( ‘jquery’ ), $version );// Add words that we need to use in JS to the end of the page so they can be translated and still used.
$params = array(
‘my_favs’ => __( ‘My Favorites’, ‘buddypress’ ),
‘accepted’ => __( ‘Accepted’, ‘buddypress’ ),
‘rejected’ => __( ‘Rejected’, ‘buddypress’ ),
‘show_all_comments’ => __( ‘Show all comments for this thread’, ‘buddypress’ ),
‘show_all’ => __( ‘Show all’, ‘buddypress’ ),
‘comments’ => __( ‘comments’, ‘buddypress’ ),
‘close’ => __( ‘Close’, ‘buddypress’ ),
‘view’ => __( ‘View’, ‘buddypress’ )
);wp_localize_script( ‘dtheme-ajax-js’, ‘BP_DTheme’, $params );
}
add_action( ‘wp_enqueue_scripts’, ‘bp_dtheme_enqueue_scripts’ );
endif;
?>lol tracking each other down :L
Thank you for replying, the code didn’t show up on the post on the wordpress.org one, it says it was moderated, is there any chance you could post it here
Thank you for getting back to me
What would I need to add and where to load the ‘global.js’ file, It is definitely there in my _inc file.