Notifications
Clear all

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

9 Posts
3 Users
3 Likes
893 Views
dimalifragis
Posts: 2394
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: 1119
(@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: 2394

@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: 1119

@dimalifragis 

I don't get any error

dimalifragis
(@dimalifragis)
Joined: 4 years ago

Famed Member
Posts: 2394

@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: 2394

The error is:

 

Uncaught TypeError: $ is not a function

Tutrix
(@tutrix)
Joined: 4 years ago

Noble Member
Posts: 1119

@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: 2394
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: 1076

@dimalifragis same 🙂

Thanks Tutrix!