Notifications
Clear all

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

9 Posts
3 Users
3 Reactions
1,235 Views
dimalifragis
Posts: 2611
Topic starter
(@dimalifragis)
Famed Member
Joined: 5 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: 1455
(@tutrix)
Noble Member
Joined: 5 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: 5 years ago

Famed Member
Posts: 2611

@tutrix Thanks.

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

Tutrix
(@tutrix)
Joined: 5 years ago

Noble Member
Posts: 1455

@dimalifragisΒ 

I don't get any error

dimalifragis
(@dimalifragis)
Joined: 5 years ago

Famed Member
Posts: 2611

@tutrix Well .. i dunno.

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

dimalifragis
(@dimalifragis)
Joined: 5 years ago

Famed Member
Posts: 2611

The error is:

Β 

Uncaught TypeError: $ is not a function

Tutrix
(@tutrix)
Joined: 5 years ago

Noble Member
Posts: 1455

@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: 2611
Topic starter
(@dimalifragis)
Famed Member
Joined: 5 years ago

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

1 Reply
(@percysgrowroom)
Joined: 6 years ago

Noble Member
Posts: 1187

@dimalifragis same πŸ™‚

Thanks Tutrix!Β