Jump to content

spspsp

Member
  • Posts

    5
  • Joined

  • Last visited

spspsp's Achievements

Level 1

Level 1 (1/20)

0

Reputation

  1. when it worked that code seemed to only drop me at the category page, not a random page within the category (if it was the code that was doing that)
  2. <script> $( ( ) => { /* begin change button url to random page Version : 0.1d0 SS Version : 7.1 Dependancies : jQuery By : Thomas Creedon < http://www.tomsWeb.consulting/ > */ // enter button block id without the # const buttonBlockId = '#block-yui_3_17_2_1_1706584972305_1843 a'; const urlPrefix = '/read-this-trashh'; // do not change anything below, there be the borg here let r = Math.floor ( Math.random ( ) * 100 ); r = String ( r ).padStart ( 3, '0' ); const url = urlPrefix + r; $( '#' + buttonBlockId + ' a' ).attr ( 'href', url ); } ); /* end change button url to random page */ </script>
  3. I've tried using this help, but the header code does not seem to affect the button block.
  4. When I use this code, the button just links to what I replace the '/page_' with in the button settings... doesn't seem to be reacting to the code in advanced settings at all.
  5. I'm trying to get a button on my home page that links to a random post on my site, but have no idea how to do it. I've tried to look at a couple other answers... can anyone out there help simplify it for me?
×
×
  • 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.