Jump to content

Edit the Portfolio block header with code

Go to solution Solved by Spark-Plugin,

Recommended Posts

Posted

Good morning, 

 

I'm trying to edit the titles of my portfolio block, by injecting some code. (image below)

image.thumb.png.131a691c0c915889a65f3beb18e7787f.png

Once I publish the changes I've done, all the coding that was added shows on the published page, but the commands don't work. (image below)

image.thumb.png.03c89c3fed2fb5ec85d8638f1727b8c7.png

Can anyone please give me some help?

 

Thank you, 

João Freire

Posted

Hello @Spark-Plugin, this is the website: https://www.comporta.art/ , you'll find the portfolio at the end of the homepage. At this moment I had to delete the codes because the site is already online. 

This is the code I'm adding: 
image.thumb.png.68a246972f7e414f3e4dd12918ab79f9.png

"Untitled <br> <strong> José Predro Croft </strong> <br> 2021"


If it's better to have the codes published let me know and I'll do it. 

Thank you,

Posted (edited)

As shown in this image, the goal is for the title to stay like this (first image in the portfolio block): 

image.thumb.png.131a691c0c915889a65f3beb18e7787f.png

 

Right now it is: 

"Untitled - José Pedro Croft, 2021"

And I need it to stay like this: 

"Untitled 

José Pedro Croft

2021" 

 

Thank you, 

Edited by JoaoFreire
  • Solution
Posted

Hi @JoaoFreire! Thanks for  your clarification. You will need to add this code:
 

  1. Navigate to Pages > Website Tools > Code Injection.
  2. Paste the code into the FOOTER editor.
  3. Hit Save and you’re done

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $(".list-item-content__title").each(function(){
    $(this).html($(this).text());
  });
});
</script>

This should work right away, please check the screenshot to see the final result. And let me know if it helps!

Screenshot 2024-10-10 at 11.47.09.png

- Answered by Iuno from sparkplugin.com

forumsignature-recommendedcopy2.png.0579645eb1430dc7c1059541dc6456c6.png

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.