Notifications
Clear all

wpForo 1.x.x [Solved] Some css help for mentions

9 Posts
3 Users
3 Reactions
1,128 Views
dimalifragis
Posts: 2615
Topic starter
(@dimalifragis)
Famed Member
Joined: 4 years ago

Hello,

Any css guru to provide the correct css for doing this (the @matt rounded background):

Thank you

(also pls include it in your next vs2 version)

Topic Tags
8 Replies
Tutrix
Posts: 1357
(@tutrix)
Noble Member
Joined: 4 years ago

i use this little code to add a css class to it

add_action( 'wp_head', function () { ?>
<script>
    $(document).ready(function () {

        $('.wpforo-post-content a:contains("@")')
		    .addClass("member-nickname");
    });
</script>
<?php } );

now you can style via .member-nickname

for the code I use the Code Snippets plugin

surely also works with the functions.php of your WP Theme

5 Replies
dimalifragis
(@dimalifragis)
Joined: 4 years ago

Famed Member
Posts: 2615

@tutrix Thanks.

This code produces some error when f12 is viewed (something like wrong content loaded).

Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1357

@dimalifragis 

I don't get any error

dimalifragis
(@dimalifragis)
Joined: 4 years ago

Famed Member
Posts: 2615

@tutrix Well .. i dunno.

I use a custom pseudo-plugin for all my functions and adding that produces an error.

dimalifragis
(@dimalifragis)
Joined: 4 years ago

Famed Member
Posts: 2615

The error is:

 

Uncaught TypeError: $ is not a function

Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1357

@dimalifragis 

ok try this code

add_action( 'wp_head', function () { ?>
<script>
    jQuery(document).ready(function($) {

        $('.wpforo-post-content a:contains("@")')
		    .addClass("member-nickname");
    });
</script>
<?php } );
dimalifragis
Posts: 2615
Topic starter
(@dimalifragis)
Famed Member
Joined: 4 years ago

@tutrix Thanks, that latest works and i was able to style it like i wanted !!

1 Reply
(@percysgrowroom)
Joined: 5 years ago

Noble Member
Posts: 1163

@dimalifragis same 🙂

Thanks Tutrix!Â