Notifications
Clear all

Style [Solved] Sticky Post Styling

16 Posts
4 Users
2 Reactions
995 Views
Posts: 11
Topic starter
(@rngeer)
Active Member
Joined: 11 months ago

Hello all, I am fairly new to WPForo but finding it very easy to configure and maintain. One issue I am having is customizing the sticky posts background colors. I have followed steps in this post to no avail.

Sticky topic styling – How-to and Troubleshooting – wpForo Support Forum

I am using the DIVI theme and tried placing the JS code in different parts of the theme control for added scripts. I have attached a screenshot.

Any other info would be great.

 

15 Replies
BlackRaz
Posts: 406
Admin
(@blackraz)
Contributor
Joined: 8 years ago

Hi @rngeer,

https://wordpress.org/plugins/code-snippets/

You can try add the JS code using the "Code Snippets" Plugin.

2 Replies
(@rngeer)
Joined: 11 months ago

Active Member
Posts: 11

@blackraz Thank you for help, while I am doing that, it looks like it is trying to run with DIVI but I get this error in console if you have any ideas. Greatly appreciated.

 

BlackRaz
Admin
(@blackraz)
Joined: 8 years ago

Contributor
Posts: 406

@rngeer 

The error indicates that the written code is loaded in the wrong place, and the parent method has not been defined yet.

I apologize, but this is the wpForo community, and our support here is primarily focused on assisting with wpForo installation issues, settings, configuration, and similar matters. If you need assistance with changing or customizing the plugin using scripting and code, please consider opening a Pro Support request. Our developers will be able to provide more targeted help in that case.

https://wpforo.com/pro-support/#customization

Posts: 11
Topic starter
(@rngeer)
Active Member
Joined: 11 months ago

No worries, I will try the JS file upload to the theme and then the snippet plugin if that doesn't works. Appreciate the assistance.

Tutrix
Posts: 1450
(@tutrix)
Noble Member
Joined: 4 years ago

Hi @rngeer

use this code in the Code Snippets plugin

add_action( 'wp_head', function () { ?>
<script>
jQuery( "i.fa-thumbtack" ).parent().parent().parent().parent().css({ "background-color": "#f5f5f5", "border" : "1px solid #ff9900" } );
</script>
<?php } );

or this one to add a CSS class

add_action( 'wp_head', function () { ?>
<script>
jQuery( "i.fa-thumbtack" ).parent().parent().parent().parent().addClass('wpforo-topic-pinned');
</script>
<?php } );

 

 

Posts: 11
Topic starter
(@rngeer)
Active Member
Joined: 11 months ago

Very good, can I do it in Functions PHP section or need to upgrade for JS? (not a robust coder obviously)

Page 1 / 2