JamIsJam88 Posted March 24, 2021 Share Posted March 24, 2021 Site URL: https://www.yungrealestate.com/availabilities/26-east-sunset-dr How can I hide the current blog post in a summary block site-wide so that I don't have to code it for each blog post or make specific tags for each property? If I have a summary block on a property listing, I would prefer not to have it display the current property on it. emalu 1 Link to comment
ChristosVayenas Posted July 27, 2022 Share Posted July 27, 2022 Hello there, did you ever find a solution to this question? Link to comment
tuanphan Posted July 28, 2022 Share Posted July 28, 2022 Try adding this to Code Injection > Footer <script> window.addEventListener('load', function () { function removeMatchingPageFromRelatedPosts() { var currentPath = window.location.pathname; var matchingSummaryItem = document.querySelector( `[href="${currentPath}"]` ); if (!matchingSummaryItem) return; var summaryParent = matchingSummaryItem.closest('.summary-item'); summaryParent.remove(); console.log('matching blog post removed'); window.Squarespace.initializeLayoutBlocks(Y); } removeMatchingPageFromRelatedPosts(); }); </script> Code by @RyanDejaegher Quote https://ryandejaegher.com/remove-current-post-summary-block-squarespace/ 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
ChristosVayenas Posted July 29, 2022 Share Posted July 29, 2022 That worked perfectly, amazing, thank you! 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