Jump to content

Hide current post from the summary block

Recommended Posts

Site URL: https://ievaviphoto.com/

Hi, all!
Been searching for an answer to this question for a few weeks now and hoping to finally find one here 🙂 Does anyone know how to hide the current post from the summary block? Maybe @bangank36  @tuanphan
 would have some insight to this?


To give you a concrete example, I would like to hide Nyhavn Intimate Wedding w/ C + C from the summary block and, instead, display the other post with the relevant category / tag.

The link:
https://ievaviphoto.com/stories/nyhavn-alternative-wedding

*P.S. I only found a way to hide a current post but then my summary block consists of one post. The code for this:
sqs-active-slide {
display:none!important;
}

Thanks a lot!!
/ ieva
Link to comment

Hi. There is no automatic way to do this.

However if you want this to be applicable only on a few pages, we can use manual CSS. That is, you need to hide on any page, you will insert code on that page. If you have 10 pages, you will insert the code into 10 pages.

If you want this, we will give the code.

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
On 2/28/2021 at 2:44 PM, tuanphan said:

Hi. There is no automatic way to do this.

However if you want this to be applicable only on a few pages, we can use manual CSS. That is, you need to hide on any page, you will insert code on that page. If you have 10 pages, you will insert the code into 10 pages.

If you want this, we will give the code.

Hey hey! That would be very much appreciated 🙂

Link to comment
On 3/5/2021 at 6:51 AM, ievavi said:

Hey hey! That would be very much appreciated 🙂

Edit Nyhavn post >> Add a Code Block >> Paste this code

<style>
  .summary-item-list .summary-item:nth-child(1) {
    display: none;
}
</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
1 hour ago, tuanphan said:

Edit Nyhavn post >> Add a Code Block >> Paste this code


<style>
  .summary-item-list .summary-item:nth-child(1) {
    display: none;
}
</style>

 

Thank you, that works brilliantly hiding the current post! But may I know how to still display 2 posts instead of one (they are categorised by the tags)?

Link to comment
31 minutes ago, ievavi said:

Thank you, that works brilliantly hiding the current post! But may I know how to still display 2 posts instead of one (they are categorised by the tags)?

You may want to increase the number of post in summary block?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
3 hours ago, bangank36 said:

You may want to increase the number of post in summary block?

That would be one of the solutions, however I have another problem - alignment (I want to be it centered). As you will see there is no space in between when the screen size is small. May I receive some help?

The code I used for summary block:
 

.sqs-block-summary-v2 .summary-item-list {

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

The page: https://ievaviphoto.com/stories/east-london-wedding (very bottom)

Thanks a lot for your kind support!

Screenshot 2021-03-07 at 13.22.13.png

Link to comment
On 3/7/2021 at 7:24 PM, ievavi said:

That would be one of the solutions, however I have another problem - alignment (I want to be it centered). As you will see there is no space in between when the screen size is small. May I receive some help?

The code I used for summary block:
 

.sqs-block-summary-v2 .summary-item-list {

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

The page: https://ievaviphoto.com/stories/east-london-wedding (very bottom)

Thanks a lot for your kind support!

Screenshot 2021-03-07 at 13.22.13.png

Do you still need help? Center summary or center title/description?

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
6 minutes ago, tuanphan said:

Do you still need help? Center summary or center title/description?

Yes, please! I would need help making the summary block thumbnails bigger + add that space in between the images on smaller screen (mobile, tablet). As you can see in the attached image they merge into one.


Example post: https://ievaviphoto.com/stories/east-london-wedding

Thank you loads!

With regards to centering, I needed some help making the contents inside the summary block themselves to be centered (not the title or description and for this, I used the code below). So I think It's sorted - just the thumbnails are very small now, therefore I would need some further help.

.sqs-block-summary-v2 .summary-item-list {

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

Edited by ievavi
Link to comment
  • 3 months later...

To remove current post, add 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');
        }

        removeMatchingPageFromRelatedPosts();
    });
</script>

Code by @RyanDejaegher

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.