Search Results for 'Add BuddyPress Styles to a Theme'
-
AuthorSearch Results
-
October 9, 2013 at 6:32 am #172526
Hugo Ashmore
Participant@henrywright-1
I think on balance I would tend now to favour going the theme compat route, as the process best to follow in all theme/site building respects, we added extended capabilities with the template hierarchy which make it more useful and the templates and styles were updated and improved.But the other approach is perfectly valid and leaves full templates directly in your control.
Personally I like the the ability, though, of being able to neatly segregate BP templates under one root dir /community/ or /buddypress/
As for the js being the reasoning remember that both approaches essentially use copies of the same file/s so you still get those either way, one thing I’d like to see and may propose is the main js & ajax files being centralized as bp assets that both approaches could access rather than maintained separately in the theme folders – although that is the place they ought to live really.
This whole question of approach taken is one I’ve raised as there are confusing aspects and I want a codex guide that outlines the approaches on offer and brings some clarity to making choices, which we’ll pencil in to the new guides once Codex is straightened out.
September 30, 2013 at 9:14 pm #172062In reply to: Duplicate Avatars in Activity Stream
Uncle Jimmy
Participant@Shanebp and @mercime [RESOLVED]
The following file was responsible. Comments marked !!!IMPORTANT!!! are where I made changes.
wp-content/plugins/gantry-buddypress/bpt-functions.php
<?php /** * @version 1.3 November 8, 2012 * @author RocketTheme, LLC http://www.rockettheme.com * @copyright Copyright © 2007 - 2012 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ // Sets up WordPress theme for BuddyPress support. function gantry_bp_tpack_theme_setup() { global $bp, $gantry_bp_path; // Load the default BuddyPress AJAX functions if it isn't explicitly disabled require_once( $gantry_bp_path . '/_inc/ajax.php' ); if ( !is_admin() ) { ///!!!IMPORTANT!!!/// COMMENTED OUT BY UNCLEJIMMY [[FIXED MEMBER HEADER DUPLICATE BUTTONS Friends/Public Message/Private Message]] ///!!!IMPORTANT!!!/// ///!!!IMPORTANT!!!/// [[ALSO REDUCED QUADRUPAL MESSAGES/COMMENTS/REPLIES TO DUPLICATES]] ///!!!IMPORTANT!!!/// // Register buttons for the relevant component templates // Friends button //if ( bp_is_active( 'friends' ) ) //add_action( 'bp_member_header_actions', 'bp_add_friend_button' ); // Activity button //if ( bp_is_active( 'activity' ) ) //add_action( 'bp_member_header_actions', 'bp_send_public_message_button' ); // Messages button //if ( bp_is_active( 'messages' ) ) //add_action( 'bp_member_header_actions', 'bp_send_private_message_button' ); // Group buttons if ( bp_is_active( 'groups' ) ) { ///!!!IMPORTANT!!!/// COMMENTED OUT BY UNCLEJIMMY [[FIXED DUPLICATE GROUP BUTTON Join/Leave ]] ///!!!IMPORTANT!!!/// //add_action( 'bp_group_header_actions', 'bp_group_join_button' ); add_action( 'bp_group_header_actions', 'bp_group_new_topic_button' ); add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); } // Blog button if ( bp_is_active( 'blogs' ) ) add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); } } add_action( 'after_setup_theme', 'gantry_bp_tpack_theme_setup', 11 ); // Enqueues BuddyPress JS and related AJAX functions function gantry_bp_enqueue_scripts() { // Enqueue the global JS - Ajax will not work without it wp_enqueue_script( 'dtheme-ajax-js', get_template_directory_uri() . '/_inc/global.js', array( 'jquery' ), bp_get_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_x_comments' => __( 'Show all %d comments', 'buddypress' ), 'show_all' => __( 'Show all', 'buddypress' ), 'comments' => __( 'comments', 'buddypress' ), 'close' => __( 'Close', 'buddypress' ), 'view' => __( 'View', 'buddypress' ), 'mark_as_fav' => __( 'Favorite', 'buddypress' ), 'remove_fav' => __( 'Remove Favorite', 'buddypress' ), 'unsaved_changes' => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ), ); wp_localize_script( 'dtheme-ajax-js', 'BP_DTheme', $params ); // Maybe enqueue comment reply JS if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } add_action('wp_enqueue_scripts', 'gantry_bp_enqueue_scripts'); // Enqueues BuddyPress basic styles function gantry_bp_enqueue_styles() { global $gantry_bp_url; // Do not enqueue CSS if it's disabled if (get_option( 'gantry_bp_disable_css' )) return; // BP 1.5+ if ( version_compare( BP_VERSION, '1.3', '>' ) ) { $stylesheet = 'bp.css'; // Bump this when changes are made to bust cache $version = '20110918'; } // Add the wireframe BP page styles wp_enqueue_style( 'bp', $gantry_bp_url . '/' . $stylesheet, array(), $version ); // Enqueue RTL styles for BP 1.5+ if ( version_compare( BP_VERSION, '1.3', '>' ) && is_rtl() ) wp_enqueue_style( 'bp-rtl', $gantry_bp_url . '/' . 'bp-rtl.css', array( 'bp' ), $version ); } add_action('wp_enqueue_scripts', 'gantry_bp_enqueue_styles'); // Gantry BuddyPress plugin doesn't use bp-default's built-in sidebar login block, // so during no access requests, we need to redirect them to wp-login for // authentication. if (!function_exists('gantry_bp_use_wplogin')) { function gantry_bp_use_wplogin() { // returning 2 will automatically use wp-login return 2; } add_filter('bp_no_access_mode', 'gantry_bp_use_wplogin' ); } // Hooks into the 'bp_get_activity_action_pre_meta' action to add secondary activity avatar support function gantry_bp_activity_secondary_avatars( $action, $activity ) { // sanity check - some older versions of BP do not utilize secondary activity avatars if ( function_exists( 'bp_get_activity_secondary_avatar' ) ) : switch ( $activity->component ) { case 'groups' : case 'friends' : // Only insert avatar if one exists if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) { $reverse_content = strrev( $action ); $position = strpos( $reverse_content, 'a<' ); $action = substr_replace( $action, $secondary_avatar, -$position - 2, 0 ); } break; } endif; return $action; } ///!!!IMPORTANT!!!/// COMMENTED OUT BY UNCLEJIMMY [[FIXED DUPLICATE AVTIVITY STREAM AVATARS]] ///!!!IMPORTANT!!!/// ///!!!IMPORTANT!!!/// [[ALSO FIXED DUPLICATE MESSAGES/COMMENTS/REPLIES]] ///!!!IMPORTANT!!!/// //add_filter('bp_get_activity_action_pre_meta', 'gantry_bp_activity_secondary_avatars', 10, 2);Thank you for your time and attention, please let me know if I could’ve done this better.
God Bless
September 22, 2013 at 10:38 pm #171677In reply to: Two installations have failed
Eric J T
ParticipantSorry I didn’t include the code for that. Yes, it is in the wp functions.php file, but it is relevant to bp theme. Here is the full function that line 100 is found in. Line 100 is the third to last, which starts with “add action”.
/** * Sets up theme defaults and registers support for various WordPress and BuddyPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. * * To override bp_dtheme_setup() in a child theme, add your own bp_dtheme_setup to your child theme's * functions.php file. * * @global BuddyPress $bp The one true BuddyPress instance * @since BuddyPress (1.5) */ function bp_dtheme_setup() { // Load the AJAX functions for the theme require( get_template_directory() . '/_inc/ajax.php' ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme comes with all the BuddyPress goodies add_theme_support( 'buddypress' ); // This theme uses post thumbnails add_theme_support( 'post-thumbnails' ); // Add default posts and comments RSS feed links to head add_theme_support( 'automatic-feed-links' ); if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { // Register buttons for the relevant component templates // Friends button if ( bp_is_active( 'friends' ) ) add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 ); // Activity button if ( bp_is_active( 'activity' ) && bp_activity_do_mentions() ) add_action( 'bp_member_header_actions', 'bp_send_public_message_button', 20 ); // Messages button if ( bp_is_active( 'messages' ) ) add_action( 'bp_member_header_actions', 'bp_send_private_message_button', 20 ); // Group buttons if ( bp_is_active( 'groups' ) ) { add_action( 'bp_group_header_actions', 'bp_group_join_button', 5 ); add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); } // Blog button if ( bp_is_active( 'blogs' ) ) add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); } } add_action( 'after_setup_theme', 'bp_dtheme_setup' ); endif; if ( !function_exists( 'bp_dtheme_enqueue_scripts' ) ) :In the first install the failed bp had been installed and working for a few days. It suddenly gave errors when I edited a css color code on line 1211 in this file and uploaded it to the server by ftp. Yeah, I know you might say I made a mistake, but I know I did it correctly. And they you might say the file got corrupted in transfer, except that the second install on godaddy had no such changes or transfers and in short order – less than an hour of use with no other plugins or style changes – gave the same final error for line 100 when I changed my public name in the buddypress members listing, at which point neither the front nor back ends were accessible.
Looking forward to your insights.
September 15, 2013 at 7:43 pm #171349@mercime
ParticipantIf there’s a tutorial on how to convert the default pages into buddypress ones I’d take that too.
@ptvstudios BuddyPress components are in fact inserted into the default pages (page.php) of WordPress themes and have only the basic styles so that the elements of the BP components would take on the styles set up by your theme for a more seamless integration.If the BP pages are showing as full-width, it could most probably be because the default page of your premium theme is full-width in the first place. To make all BP pages 2 columns, find your theme’s template with a 2-column layout and copy source code over to a new file named buddypress.php, save and then upload buddypress.php to your theme folder in server. If this doesn’t work out for you, please contact the premium theme author to help you set up the buddypress.php file to 2 columns. Good luck!
September 14, 2013 at 2:52 am #171316@mercime
ParticipantI created a buddypress.php by copying the code tooked from the page-template-fullwidth.php. It didn’t work
@resistoyen sometimes it doesn’t work right away. To continue, using this page as reference:
https://themes.trac.wordpress.org/browser/oxygen/0.5/page-template-fullwidth.php?rev=24186a) Remove the following from your buddypress.php file
Line 3: Template Name: Full Width
Line 13-17:<div class="aside">to closing</div>b) Change Line 21 from
<div class="content-wrap">
to
<div class="content-wrap bp-full-width">c) Add this to your theme’s stylesheet
.bp-full-width { width: 100% !important; }July 30, 2013 at 10:01 am #169078In reply to: Converting Buddypress 1.8 to Bootstrap
Hugo Ashmore
Participant@jtm21
Yes essentially that would be fine, bearing in mind you might lose or have to account for any styles that were in place to deal with js frills.Generally now you can or should be using BP in theme compat mode as it offers more options now as well as ability to keep templates and assets neatly under /buddypress/ or /community/ adding directories directly to you theme root will invoke the older approach, and although still valid, less of a attraction now the theme compat templates can be customized for components, actions, user_ids etc.
Check the functions.php in the bp-legacy template folders as that will show you the class used for setting up a theme and it’s assets.
July 26, 2013 at 10:53 am #168853Hugo Ashmore
ParticipantNo the whole point of the bundled styles is not to lend any particular visual styles over and above basic layout stuff otherwise it would have never been possible to implement BP theme compatibility, these styles have to slot into any theme, themes we have no way of predicting in terms of their own visual style. it is up to you to add whatever additional styles you need for BP to sit with your theme.
Or find a theme that has been pre-built to use BP.
July 26, 2013 at 2:45 am #168837In reply to: Weird theme integration
@mercime
Participant@hugodisasters
– Change to Twenty Twelve theme and check the BP pages if has at least some styles applied.
– View source code of site to check if the files I mentioned above are in source.If yes to both, then something’s blocking BP from enqueueing BP’s JS and CSS files in your deTube theme. Check theme’s functions.php file if there’s something like add_theme_support(buddypress). If so, remove it.
July 10, 2013 at 5:46 pm #167897In reply to: Removing buddypress from wp_head
modemlooper
Moderatordo you want to edit css or just get rid of it all together? You can add blank files. Adding these files will override bp’s files. If they are blank nothing gets loaded:
yourtheme/css/buddypress.css
yourtheme/js/buddypress.jsOr try and remove hook action:
remove_action(‘bp_enqueue_styles’);
remove_action(‘bp_enqueue_scripts’);June 29, 2013 at 4:29 pm #167212In reply to: Remove Comment box html tags option
@mercime
Participant@tengwah If you want to keep the changes that you’re making to the BuddyPress Default theme, I suggest that you create a child theme and make the modifications there.
Simple way to remove the tags, add the following to your child theme’s stylesheet:
#commentform p.form-allowed-tags { display: none; }June 29, 2013 at 11:26 am #167184In reply to: [Resolved] Excessive vertical gap in buddypress
@mercime
Participant@disqusnow the large vertical gap is caused by the style applied to the container of the group avatar and group admin/s avatar. To correct the issue, add the following at the bottom of your theme’s stylesheet:
#buddypress div#item-header {
overflow: visible !important;
}June 24, 2013 at 1:06 am #166685In reply to: Buddypress in conflict with WP media upload
mindimer
ParticipantWill try. Have to backup and then kick everyone off the system and see if that takes care of it. And then have to figure out how to customize without changing core files!! I have an external css that adds onto the theme’s original css, but each part of BP and plugins have their own css and tons of files, so I think it became easier to alter the files, instead of creating a child theme. One of my partners is a hand coder, old school, and it’s been hard to mesh styles.
June 20, 2013 at 1:01 pm #166478Henry
MemberThe easiest way to inherit ‘some’ of the CSS from the default theme is to copy what you need and paste it into your theme’s style.css.
Then add this to your functions.php file
if ( !function_exists( 'bp_dtheme_enqueue_styles' ) ) : function bp_dtheme_enqueue_styles() {} endif;This will tell BuddyPress not to queue up the default stylesheet.
June 16, 2013 at 4:19 am #166144In reply to: [Resolved] RTL problem in members page.
@mercime
Participant@mahdiar Add this to your theme’s stylesheet
#buddypress ul.item-list li div.action {
left: 0 !important;
}June 4, 2013 at 7:59 am #165342In reply to: Mesocolumn – free theme for buddypress
@mercime
Participant@rkcorp The theme looks great.
While awaiting theme review (up to 4 weeks), please make sure that your theme meets the WordPress Theme Review guidelines. Scanned source code at themes trac and there are issues which need to be be addressed. e.g. scripts and styles in <head> for one.
The following information should be of assistance in getting your theme to meet all the criteria:
* Theme Review – https://codex.wordpress.org/Theme_Review
* Theme Unit Checklist – https://codex.wordpress.org/Theme_Unit_Test
* Theme Development – https://codex.wordpress.org/Theme_Development
* Theme-Check Plugin – https://wordpress.org/extend/plugins/theme-check/
* Debogger Plugin – https://wordpress.org/extend/plugins/debogger/After you’ve updated your theme to meet WP Theme Review guidelines, you’ll just need to upload a new version of the theme. You’ll still retain your place in the theme review queue.
June 2, 2013 at 6:02 pm #165244In reply to: [Resolved] Chaning font color
@mercime
Participant@dowy Add the following to your theme’s stylesheet:
#buddypress table tr.alt td {
background: none transparent !important;
}#buddypress table tr td.label {
border-right: none !important;
}.label {
background-color: transparent !important;
}May 17, 2013 at 9:47 am #164145Tammie Lister
ModeratorAre all styles overloading or just some? If just some it could be forcing styles through.
Are you also using BuddyPress 1.7.2 (or 1.7.x)?However, if it’s all then can you check if the theme has this line in it:
add_theme_support( 'buddypress' );If no, then can you try with another theme just to see if it’s Avenue that’s being grumpy? Maybe something like the default WordPress Twenty-Twelve would be a nice test theme.
April 26, 2013 at 9:08 am #162792Hugo Ashmore
ParticipantYour theme imposes rather generic styles on li elements in the content areas under a parent class of ‘shortcodes’ This is conflicting with the BP object nav li elements forcing them to 100% width.
In your themes stylesheet you’ll need to try adding something like:
<code>
#buddypress div.item-list-tabs ul li {
width: auto;}
</code>
Other than that it’s a case of using that top level id #buddypress to further style BP elements in what ever stylesheet is applicable using tools such as firebug to identify the rulesets and their selectors that BP has already set.
April 22, 2013 at 5:27 pm #162357Hugo Ashmore
ParticipantTrying to make sense of what your process has been here as you shouldn’t be having issues.
Going back up two posts if as you say you built originally for template pack or using template pack then when you tried to switch to 1.7 theme compat you should not have tried to move the existing folders/files into the theme compat folder structure, that will not work older bp-default templates and newer legacy ones are not the same new templates do not have head/footer elements.
I think you need to continue on with BP as a child theme but probably with the add_theme_suport line added and then handle enqueueing / including the styles/js yourself.April 20, 2013 at 12:37 pm #162221Hugo Ashmore
ParticipantThere is documentation! it’s in the documentation section of the site.
https://codex.buddypress.org/developer/theme-development/a-quick-look-at-1-7-theme-compatibility/However as Paul says or:
Copy over the stylesheet from /bp-templates/bp-legacy/css/buddypress.css to your theme /css/ that will override the original copy, either add to that sheet or start from scratch but for simple changes do as Paul says and work in styles.css
April 6, 2013 at 12:50 pm #160084Hugo Ashmore
Participant@epatrick
Just to illustrate why it’s NOT a BP issue.You are missing a series of styles that are getting generated and injected into the head of each page (not a good approach but hey ho)
e.g. .skinset-menu{}Now quite why these styles are not getting added to actual single groups although they are to the parent directory is a question only the theme authors can answer.
it’s their theme and their approach to applying their styles and functions, as to why their approach doesn’t work on the group single views is only something that can be understood by de-constructing the theme as we and BP have no knowledge of that it’s next to impossible to help, thus it IS their duty to help or guide you, perhaps a setting you’ve missed in the backend?
I don’t mean this to sound unhelpful on our part but just trying to point out the issues from our perspective.
April 3, 2013 at 7:35 am #159761In reply to: create a child theme/change style
danbpfr
Participanthi @talitaco,
BP 1.7 introduce a new template era.
So for child theme, you don’t have to add the import comments to styles.cssYou also need to read and read and read, untill you get it, the Codex:
https://codex.buddypress.org/theme-compatibility/add-buddypress-styles-to-a-theme/
https://codex.buddypress.org/developer-and-designer-information/March 28, 2013 at 2:06 pm #159004Unsal Korkmaz
Participant@mercime ty 🙂
An update: I wrote an article about child-themes and how to add/remove custom bootstrap styles:
March 26, 2013 at 9:15 pm #158680In reply to: How to make a child theme?
@mercime
Participant@bandtobuy 1. BuddyPress should be activated before child theme of bp-default theme is recognized in themes. or 2. Did you add the stylesheet header in your new style.css file? you didn’t say.
/*
Theme Name: My Child theme
Theme URI: – optional –
Author: Your Name
Author URI: – optional –
Description: – optional –
Version: – optional, but better to add version –
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: buddypress
Theme: bp-default
*/March 23, 2013 at 4:13 pm #157555In reply to: Registration button invisible
maphorn
ParticipantTried in
yourdomain.com/your wordpress installation directory/wp-content/plugins/buddypress/bp-themes/bp-default/styles.css – still not showing.Also tired
yourdomain.com/your wordpress installation directory/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/default.cssline 1658 .standard-form input[type=text] { press enter and add
to new Line 1659 color: #000 importantStill no registration button?
Any help much appreciated
-
AuthorSearch Results