Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Looking for some code to remove or hide the content page of a blog in squarespace


Estela

Question

Site URL: https://www.seaforestation.com/

Hi everyone! 

I am curating content for my website seaforestation.com and would love to use the blog structure to give dynamisms to it and have the feeling that news are updated regularly. Because the content is outside of my website I don't need the blog article with the content inside my website, so I would like to get rid of it. Long story short, If a blog is compose of 2 pages I only need the first one displaying all the grid of articles. Any ideas? Thank you!

 

this is what I want to hide or delete

blog.thumb.png.8f7c981e94334ed2ee58168c12da2748.png

Link to comment
  • Answers 11
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

Posted Images

11 answers to this question

Recommended Posts

  • 0

This is the link to the blog article display

https://www.seaforestation.com/blog-2

Then every article has the content like this

https://www.seaforestation.com/blog-2/blog-post-title-two-h8tf4

https://www.seaforestation.com/blog-2/blog-post-title-three-m26pk

https://www.seaforestation.com/blog-2/blog-post-title-four-55mdr

That I would like to make invisible or delete 🙂

Then my question would be, every time I will create a entry in the blog, Should I put the code to delete the content page? 

Thank you!!!

Link to comment
  • 0
17 hours ago, Estela said:

This is the link to the blog article display

https://www.seaforestation.com/blog-2

Then every article has the content like this

https://www.seaforestation.com/blog-2/blog-post-title-two-h8tf4

https://www.seaforestation.com/blog-2/blog-post-title-three-m26pk

https://www.seaforestation.com/blog-2/blog-post-title-four-55mdr

That I would like to make invisible or delete 🙂

Then my question would be, every time I will create a entry in the blog, Should I put the code to delete the content page? 

Thank you!!!

Add this to Blog-2 Page Header (Hover on Blog on Navigation or Not Linked > Click Gear icon to open Page Header)

<style>
  .blog-item-wrapper.blog-basic-grid-item-wrapper {
    display: none;
}
  section.item-pagination.item-pagination--prev-next {
    display: none;
}
</style>

 

Link to comment
  • 0

Add the following to Settings > Advanced > Code Injection > HEADER.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

Add the following to Blog Settings > Advanced > Page Header Code Injection for the blog page.

<script>

  $( ( ) => {
  
    /*
    
      change blog listing item image URL to Source URL
      
      SS Version : 7.1
      
      */
      
    let targetAtttributeValue = ''; /* use _self | _blank | _parent | _top |
                                       framename see
                                       < https://mzl.la/2Q0JROF > */
    
    // do not change anything below, there be the borg here
    
    if ( ! $( '.blog-basic-grid' ).length ) return; /* bail if not blog listing
                                                       page */
    $( '.blog-title .passthrough-link' )
    
      .filter ( function ( ) {
      
        return $( this ).attr ( 'target' ) !== undefined;
        
        } )
        
      .each ( function ( ) {
      
        const $this = $( this );
        
        const url = $this.attr ( 'href' );
        
        let $imageLink = $this
        
          .parents ( '.blog-item' )
          
          .find ( 'div:first .image-wrapper' )
          
            .attr ( 'href', url );
            
        if ( ! targetAtttributeValue ) {
        
          const v = $this.attr ( 'target' );
          
          if ( v !== undefined ) targetAtttributeValue = v;
          
          }
          
        if ( targetAtttributeValue )
        
          $imageLink.attr ( 'target', targetAtttributeValue );
          
        } );
        
    } );
    
  </script>

This is for v7.1.

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as best , and see my profile. Thanks for your support!

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