Jump to content

Adding text content above blog page on 7.0

Recommended Posts

Site URL: https://www.leo2021.org/

Hi, I am attempting to add a small bit of text or an image between the navigation menu and the blog section of this site (which is set as the homepage), in order to provide a link to a blog archive at a separate URL.

I am not experienced at adding custom code, but ultimately just looking for a workaround to apply to only the blog page of this site. I am hoping this will be an easy fix for someone more experienced in customizing SqSp pages, and thanks in advance for any advice!

Link to comment
  • Replies 6
  • Views 987
  • Created
  • Last Reply
On 5/5/2021 at 12:04 AM, Monojono said:

Site URL: https://www.leo2021.org/

Hi, I am attempting to add a small bit of text or an image between the navigation menu and the blog section of this site (which is set as the homepage), in order to provide a link to a blog archive at a separate URL.

I am not experienced at adding custom code, but ultimately just looking for a workaround to apply to only the blog page of this site. I am hoping this will be an easy fix for someone more experienced in customizing SqSp pages, and thanks in advance for any advice!

Add to Design > Custom CSS

/* home top text */
body.homepage div#pageWrapper:before {
    content: "Squarespace";
    display: block;
    text-align: center;
}

image.thumb.png.204aebe328df7c9748696d1eda7c4866.png

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
  • 4 weeks later...

Hi @tuanphan, thanks so much for your help! This seems to work with plaintext, but when I customize to include a text link it throws an error. I've been messing with the syntax to try to fix this but no luck so far!

Here is the text I am working with based on your advice:

 

/* home top text */

body.homepage div#pageWrapper:before {

    content: <a href="https://leounion.org/blog">Click here </a> for all LEO Blog posts and news";

    display: block;

    text-align: center;

}
 

I'll also include a screenshot of where it seems to create an error:
1546753099_ScreenShot2021-06-03at5_47_18PM.thumb.png.b336efed59e3540398bbad3d709a522a.png



Any ideas would be greatly appreciated, thanks so much!

Link to comment
17 hours ago, Monojono said:

Hi @tuanphan, thanks so much for your help! This seems to work with plaintext, but when I customize to include a text link it throws an error. I've been messing with the syntax to try to fix this but no luck so far!

Here is the text I am working with based on your advice:

 

/* home top text */

body.homepage div#pageWrapper:before {

    content: <a href="https://leounion.org/blog">Click here </a> for all LEO Blog posts and news";

    display: block;

    text-align: center;

}
 

I'll also include a screenshot of where it seems to create an error:
1546753099_ScreenShot2021-06-03at5_47_18PM.thumb.png.b336efed59e3540398bbad3d709a522a.png



Any ideas would be greatly appreciated, thanks so much!

Hi. You can't add link with this way. Will need to use JavaScript. Do you use Personal Business or Commerce Plan?

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:

Hi. You can't add link with this way. Will need to use JavaScript. Do you use Personal Business or Commerce Plan?

Hoo boy, ok—thanks for the speedy reply! This is a business plan, not commerce, though it appears that JavaScript should be available on both from what I can see.

Link to comment
21 hours ago, Monojono said:

Hoo boy, ok—thanks for the speedy reply! This is a business plan, not commerce, though it appears that JavaScript should be available on both from what I can see.

Add to Settings . Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
  $(document).ready(function() { 
		$('<p class="ttext"><a href="https://beaverhero.com">Click here</a> to see detail</p>').insertBefore('body.homepage #page>article:first-child');
	});
</script>
<style>
  p.ttext {
    text-align: center;
    font-size: 30px;
}
  p.ttext a {
    border-bottom: 1px solid;
}
</style>

image.thumb.png.4d004156588454a91397de113fa36b35.png

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

Archived

This topic is now archived and is closed to further replies.

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