Notifications
Clear all

wpForo 1.x.x [Closed] How to add css class??

8 Posts
2 Users
0 Reactions
1,520 Views
Posts: 30
Topic starter
(@civilenggnotes)
Eminent Member
Joined: 5 years ago

with reference to this link ( https://wpforo.com/community/how-to-and-troubleshooting/where-can-i-find-and-edit-the-file-with-login-register-links-on-the-js-popup/ ), how could I set the class by the second method. I could not understand properly. I have moved the file to my child theme directory. So, I think, there will be no update problem. 

7 Replies
Alvina
Posts: 1863
Moderator
(@alvina)
Member
Joined: 5 years ago

Hi @civilenggnotes,

The second method provided in the above link means that another way to change the login link is customizing the add_footer_html() function and make it work as you need.

Also please provide in detail what you want to change, provide the screenshot, and we will try to help you.

Posts: 30
Topic starter
(@civilenggnotes)
Eminent Member
Joined: 5 years ago

I want to add the css class for the ajex login model to popup every time the the login/register button is clicked. and also the add topic for non logged-in users. I have 3 screenshot. so I am attaching the google drive link. please have alook.

1. https://drive.google.com/open?id=1cgHsMj9QXWhKit7Nzu7G-1chEbERcTku

2. https://drive.google.com/open?id=1mJ5AJpckrSK3mciyWplgal_Dhv8By4oe

3. https://drive.google.com/open?id=15ycLSx2xsqDCR6N7SNZtJJ4Gbvu5Uj5J

Posts: 30
Topic starter
(@civilenggnotes)
Eminent Member
Joined: 5 years ago
Posted by: @alvina

means that another way to change the login link

I understand that. and my question is there. I found the following code in the class-template.php file.

    public function add_footer_html(){
	    $this->dialog();
	    $this->spinner();
	    if( apply_filters( 'wpforo_message_bubble', true ) ) $this->msg_box();
	    if( WPF()->current_object['template'] === 'post' ) $this->report_form();
    }

What to add/replace, I could not understand. If I only have to add the below code, above/below which line I should put? and I think it is for the login, so what about the registration?? and last question, do I have to change anything for logout option??

jQuery(document).ready(function(){
jQuery('#wpf-msg-box a[href$="?wpforo=signin"]').replaceWith('<span class="lrm-login">Login</span>');
});
1 Reply
Alvina
Moderator
(@alvina)
Joined: 5 years ago

Member
Posts: 1863

@civilenggnotes,

how could I set the class by the second method. I could not understand properly. I have moved the file to my child theme directory. So, I think, there will be no update problem. 

We strongly recommended doesn't use the second method if you don't have a knowledge in programming. This is not the update save way, as Sofy already mentioned.

 and I think it is for the login, so what about the registration??

You just need to use the code provided by Sofy as described here, to make it work:

jQuery(document).ready(function(){
jQuery('#wpf-msg-box a[href$="?wpforo=signin"]').replaceWith('<span class="lrm-login">Login</span>');
});

Just change the red marked value, with your class name.

Also please note if you remove the #wpf-msg-box selector from the code above, it'll replace all login links (wpForo). 

For the register page, you just need to change the wpforo=signin to wpforo=signup in the code provided above.

Posts: 30
Topic starter
(@civilenggnotes)
Eminent Member
Joined: 5 years ago

Should i put this code below this line??

public function add_footer_html(){

Or above the ending bracket"}"??
2 Replies
Alvina
Moderator
(@alvina)
Joined: 5 years ago

Member
Posts: 1863

@civilenggnotes,

Please follow the steps below to put the code:

1. Install the Simple Custom CSS and JS plugin:  https://wordpress.org/plugins/custom-css-js/

2.  Add the following JS code via the plugin.

(@civilenggnotes)
Joined: 5 years ago

Eminent Member
Posts: 30

hi @alvina

i have tried this, but it is not working. i need to use the same 'lrm-login' class. So, I am deactivating the plugins..