BuddyDev

Search

[Resolved] BP Ajax Registration – Overriding modal styles from theme

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #21658

    I recently updated BuddyPress Ajax Registration and noticed that the styling suggestions had changed.

    So I set up a theme subdirectory yourtheme/bpajaxr/assets/bpajaxr-style.css as indicated in the documentation for BuddyPress Ajax Registration, but the css file did not load.

    I can enqueue the css file within functions.php in the usual way and it loads fine, but the documentation suggests that a specific directory tree is wanted — vs., say, just including the css in the theme’s style.css or anyplace within the child directory structure so long as it’s enqueued within functions.php.

    Could you enlighten us as to why a specific theme subdirectory structure is suggested?
    reference – https://buddydev.com/docs/buddypress-ajax-registration/overriding-modal-styles-from-theme/

  • Keymaster
    (BuddyDev Team)
    Posts: 21763
    Brajesh Singh on #21683

    HI Diana,
    Thank you for the question.

    The patch should be

    
    yourtheme/bpajaxr/default/assets/bpajaxr-style.css
    
    

    We suggest using

    
    yourtheme/bpajaxr/default
    

    The last part is name of the active template style(currently, we only support default but will change in future) to help us localize the change and add more styles in future without breaking backward compatibility.

    Keeping this structure, you can keep your changes local to a specific style. Say, we add a new style “classic” in future, if you maintain this structure, changes for styles in the default won’t affect new.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #21689

    Thank you, Brajesh.

    I’ll upload the style when I’m done, in case anyone else wants to use it or something similar.

  • Keymaster
    (BuddyDev Team)
    Posts: 21763
    Brajesh Singh on #21721

    Thank you Diana.
    I am looking forward to it.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #22034

    It’s working although it would be nice if I didn’t have to put !important for every single css attribute in order to overrride. I am still enqueing — perhaps that is not necessary?

  • Keymaster
    (BuddyDev Team)
    Posts: 21763
    Brajesh Singh on #22053

    Hi Diana,
    You should not use !important. It is not needed for this plugin.
    May I know here have you put the custom css file?

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #22060

    Hi Brajesh,

    I added a bunch more css and only had to use !important on some of them. I just got unlucky on the first few, I guess.

    File is in

    M:\Ampps\www\wp\wp-content\themes\customizr-child\bpajaxr\default

    on my local drive. I have all the css done — I think — but the submit button isn’t working so far as I can determine. I tried just the login form and the wheely icon just spins & spins. I am going to set everything back to defaults and if it still doesn’t work, will upload to the host server to debug further.

    Should I disable the enque, or leave it in?

    wp_enqueue_style( 'bp-register-style', get_stylesheet_directory_uri() . '/bpajaxr/default/bpajaxr-style.css' );

    Before this plugin was updated you had me use the following function in my functions.php:

    
    function buddydev_login_load_ajaxr_styles() {
    	wp_enqueue_style( 'bp-custom-ajaxr-1', get_stylesheet_directory_uri() . '/bp-ajax-register.css' );
    }
    add_action( 'login_enqueue_scripts', 'buddydev_login_load_ajaxr_styles' ,11);
    

    I thought perhaps that wasn’t needed with the plugin update and took it out. Perhaps that was a mistake.

    Thank you for hanging in there with me. I must say, I was in complete despair before I found your BuddyPress registration plugin. The extra options and admin interface on the plugin are a lovely upgrade.

    When I get things working, I’ll email you the css file. It’s 2-column and looks pretty sharp.

    Diana

    • This reply was modified 3 years, 5 months ago by Diana.
  • Keymaster
    (BuddyDev Team)
    Posts: 21763
    Brajesh Singh on #22063

    Hi Diana,
    Thank you for the kind words.

    1. Please remove the enqueue statement.

    2. Please name your css file ‘bpajaxr-style.css’ and put it in your

    
    M:\Ampps\www\wp\wp-content\themes\customizr-child\bpajaxr\default\assets\
    

    We need to create an assets directory inside the bpajaxr/default and put the css file there.

    It will be loaded automatically and the original style won’t be loaded.

    I am looking forward to see your implementation 🙂

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #22076

    Login now working, I need to debug the registration form now. It may be a day or two before I have time to track that down.

  • Participant
    Level: Enlightened
    Posts: 32
    Diana on #22077

    Registration works with default styling; I was hiding one field I don’t want users to see but registration might gag without that. Possibly I can figure a way to appease the registration system without letting users see the BuddyPress “Name” field; I want it to be the same as the WordPress Username.

You must be logged in to reply to this topic.

This topic is: resolved