AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] Sticky Post Styling

16 Posts
4 Users
2 Reactions
3,553 Views
Posts: 12
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@rngeer)
Eminent Member
Joined: 2 years ago
[#50797]

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.

 

Screenshot 2023 12 10 074343

15 Replies
BlackRaz
Posts: 396
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@blackraz)
Contributor
Joined: 9 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: 2 years ago

Eminent Member
Posts: 12
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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.

 

 Error

BlackRaz
Admin
(@blackraz)
Joined: 9 years ago

Contributor
Posts: 396
BlackRaz
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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: 12
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@rngeer)
Eminent Member
Joined: 2 years 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: 1519
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@tutrix)
Noble Member
Joined: 6 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: 12
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@rngeer)
Eminent Member
Joined: 2 years ago

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

Screenshot 2023 12 11 111201

Page 1 / 2
Share: