Jump to content

Change title post blog color only on some posts.

Go to solution Solved by tuanphan,

Recommended Posts

  • 1 month later...
  • Solution
6 hours ago, PaolaAV said:

yes.  The posts of the virtual assistant category with red post title and the post business category posts with blue post title.  It's possible? Thanks.

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(function() {    
    var lang = location.pathname.split("/")[1]
    $('.blog-item-category--Business').parents('article').addClass('tp-business');
    $('.blog-item-category--Virtual').parents('article').addClass('tp-virtual');

  });
</script>
<style>
  .tp-business h1.entry-title {
    color: red !important;
}
  .tp-virtual h1.entry-title {
    color: blue !important;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.