Welcome

This code snippet library features advanced modifications you can make to customize your Squarespace 5 site. While we do not provide custom programming support, we've assembled the following guides as a reference to help you get started.


HTML Guide

CSS Guide

Javascript Guide

Entries in Easy (37)

Thursday
May032012

Hide the Author Link In Journal Entries 

Example: Prevent the default author link from appearing in journal entries. 

Note: Replace the LOGIN-NAME portion for the author specific code below with the login name of the member whose author link you want to hide from display.  

/* Hide A Specific Author Link */ 

.authored-by-LOGIN-NAME .posted-by { display: none; }

/* Hide All Author Links */

.posted-by { display: none; }

Saturday
Feb182012

Remove the Site Title Link

Example: Remove the link from your site title text. 

Note: This script removes the 'a href' link from the h1 site title; the text itself will appear but without being linked.

In Extra Header Code Injection put: 

<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.js" type="text/javascript"> </script>
<script type="text/javascript">
$(document).ready(function() {
$('#siteTitle a').removeAttr("onclick");
})</script>

 In Custom CSS put: 

#siteTitle a { cursor: text; }

Monday
Jan092012

Hide or Display Counts In Journal Archive Widgets

Example: Hide or display count numbers in journal index (journal archive) widgets

/* Hide Counts In Journal Archives Lists */

.section ul.archive-item-list-pt li .entry-count {
display: none; }
/* Display Counts in Journal Archives Lists */ 

.section ul.archive-item-list-pt li .entry-count {
display: block;
float: right; }
Wednesday
Dec212011

Hide the "Entries In" Journal Filter Overview Text

Example: Hide the "Entries In" system text that displays in category and tag overview pages within your journals. 

In Custom CSS put either of the following: 

/* To hide this on all journal overview pages */

.journal-filter-header {display: none;}

 

 /* To hide this on only specific journal pages */

#modulePage1234567 .journal-filter-header {display: none;}

Tuesday
Oct042011

Display Bullets In Sidebar Sections

Example: Display bullets in unordered lists within sidebar sections.

Note: You can specify circle, disc or square bullets in the code below and adjust or omit margins to your preference. 

In Custom CSS put:

.section ul li {
list-style-type: square;
list-style-position: inside;
margin: 10px 0px;
}

Wednesday
Sep142011

Change the Slideshow Background Color

Example: Change the default gray background color in Squarespace slideshows to the color of your choice.

/* To use a specific color */

.squarespace-slideshow { background-color: #ffffff !important; }

/* To set as transparent */

.squarespace-slideshow { background-color: transparent !important; }

Friday
Sep092011

Disable Right Click 

Example: Disable "right click" to visitors of your site.  

In  Header Code Injection put: 

<script src="http://ajax.googleapis.com/ajax/libs/jquery
/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$(function () {
$(this).bind("contextmenu", function (e) {
 e.preventDefault();
});
});
</script>

 

Monday
Feb212011

Add A Background Color To Sidebar Columns

Example: You want the sidebars in your site to appear with one continuous background color.

In Custom CSS:

/* You may need to add/edit or adjust margins and padding to your preference. */

#sidebar1Wrapper {background: #333333; padding: 0px 10px; margin: 0px;}

#sidebar2Wrapper {background: #666666; padding: 0px 10px; margin: 0px;}

Monday
Jan102011

Set Line Height Space On List Elements

Example: Set the line height spacing on ordered or unordered lists to your preference.

Note: You can change the below em measure to use pixels — and increase or decrease the line height to your preference.

/ * For unordered lists (bullets) */
ul li{
line-height:1.0em;
}
/ * For ordered lists (numerical) */
ol li{
line-height:1.0em;
}
Tuesday
Dec142010

Align Images In Journal Entry Excerpts

Example:  Align images to appear left or right of summary content within journal entry excerpts.

Note: You can use the word "left" or "right" in the code below to align images in excerpts to your preference.

In HTML put:

<p><span class="full-image-float-left"><span><img src="/storage/yourimage.jpg" alt="" title=""/></span></span>Your journal excerpt text here.</p>

Thursday
Nov112010

Customize Text Displayed In the Picture Gallery Lightbox 

Example: Customize the title and description text in the gallery lightbox display for picture galleries.

In Custom CSS put:

#sslightbox_description p {
font-size: 14px;
font-weight: bold;
color: #ccc;
}

Tuesday
Nov092010

Put Member Login/Logout Fields On the Left Side Of Your Site

Example: You want the login/logout fields for members of your site to appear on the left side of the browser instead of on the right. 

In Custom CSS put:

#siteMemberNoticeAreaWrapper {left: 0; position: fixed; width: 210px;}

Wednesday
Sep292010

Hide System Generated Page Titles

Example: Hide system generated page titles on pages like Gallery, Map, and Amazon.

.document-title { display: none; }

Monday
Jul262010

Disable the ESC Key Listener

Example: Turns off the listener for the ESC Key to disable the redirect to your login page when pressed.

In your site Footer Area put:

<script type="text/javascript"> 
YAHOO.util.Event.removeListener(document, "keyup");
</script>

Thursday
May202010

Hide Journal Entry Navigation

Example: Hide the journal entry navigation element within your blog.

.journal-entry-navigation { display: none; }
Thursday
May202010

Add Links To Your Site Footer

Example: Add links within the footer section of your site.

 

<a href="http://www.yourlink.com">Link Text</a>
Wednesday
May192010

Auto Scale Image Widths

Example: Set a width of 500px for all journal images.

.journal-entry-text .body img { width: 500px; height:auto; }

Wednesday
May192010

Add Images To Your Site Footer

Example: Add images within the footer section of your site.

<img src="/storage/yourimage.jpg" />

Wednesday
May192010

Highlight Search Term Results

Example: Customize the appearance of search term results within your site.

 

/* Change search term text color. */

.hit-word-body { color:#cccccc; }

/* Change search term text background color. */

.hit-word-body { background-color:#cccccc; }
Tuesday
May182010

Add A Fixed Background Image

Example: Add a "fixed" background image to your site that doesn't scroll with the page.

Note: Use of this code assumes that a "background image" has already been added to the "Window Body" element within the Style Edit Mode > Fonts Colors and Sizes menu.

body { background-attachment: fixed; }