thenookcreative Posted April 6, 2021 Share Posted April 6, 2021 Site URL: https://www.bycourtneytodd.com/ Hi! Can someone help me figure out how to have different titles or headers at the top of my linked category pages? I've sorted my blog posts into categories and have linked buttons to a particular category but when I go to the category pages they all say "On The Blog" at the top and I want them to be titled based on the category. I know I can create a page and add text box then a summary blog underneath, but not all my blog categories will have their own page so I'm hoping to find a work around to have each blog category link to a page with a title of the same name (e.g. when someone clicks on the blog category "recipe" the linked page should say "recipe" at the top, and when they click "Canadian Travels" the linked page should say "Canadian Travels" at the top, etc.) Any help is very appreciated! Beyondspace 1 Link to comment
tuanphan Posted April 11, 2021 Share Posted April 11, 2021 (edited) Add t On 4/6/2021 at 7:19 AM, thenookcreative said: Site URL: https://www.bycourtneytodd.com/ Hi! Can someone help me figure out how to have different titles or headers at the top of my linked category pages? I've sorted my blog posts into categories and have linked buttons to a particular category but when I go to the category pages they all say "On The Blog" at the top and I want them to be titled based on the category. I know I can create a page and add text box then a summary blog underneath, but not all my blog categories will have their own page so I'm hoping to find a work around to have each blog category link to a page with a title of the same name (e.g. when someone clicks on the blog category "recipe" the linked page should say "recipe" at the top, and when they click "Canadian Travels" the linked page should say "Canadian Travels" at the top, etc.) Any help is very appreciated! Add this to Settings > Advanced > Code Injection > Header. Do similar for other category pages <script> if (window.location.pathname == "/blog/category/Canada+Travels") { document.querySelector('body').classList.add('canada-travels'); } </script> <style> .canada-travels section.Intro h2 { visibility: hidden; } .canada-travels section.Intro h2:before { content: "Canada Travels Blog"; visibility: visible; position: absolute; left: 50%; transform: translateX(-50%); } </style> Edited April 11, 2021 by tuanphan typo Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
thenookcreative Posted April 13, 2021 Author Share Posted April 13, 2021 Thank you for your help! I added the code like you said but nothing changed. Link to comment
tuanphan Posted April 14, 2021 Share Posted April 14, 2021 On 4/13/2021 at 7:48 AM, thenookcreative said: Thank you for your help! I added the code like you said but nothing changed. can you keep the code in Code Injection? We can check easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
thenookcreative Posted April 15, 2021 Author Share Posted April 15, 2021 Yes, added it to: Settings > Advanced > Code Injection > Header Link to comment
tuanphan Posted April 17, 2021 Share Posted April 17, 2021 @creedon Hi. Can you help this, please? Thank you :x Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
creedon Posted April 17, 2021 Share Posted April 17, 2021 Replace the scrript tag with the following. <script> window.addEventListener ( 'DOMContentLoaded', ( ) => { if ( location.pathname == '/blog/category/Canada+Travels' ) { document.querySelector ( 'body' ).classList.add ( 'canada-travels' ); } } ); </script> Let us know how it goes. tuanphan 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects. Link to comment
thenookcreative Posted April 17, 2021 Author Share Posted April 17, 2021 That worked! Thank you so much!🙂 creedon 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment