therealmiguel Posted January 7 Posted January 7 Hello there! I'd like to replace the call to action button that's currently showing on my website (drmiguelmateas.com) with a different CTA button on one page only. I have a course page with details of a course I'm offering and the CTA links to that page. However, on the course page itself (https://drmiguelmateas.com/thrive-with-adhd-course) I'd like the CTA button to link to the course login page on my Squarespace member pages. Can someone help with this? I've looked at various posts around similar situations but the code used in those has not worked. Thank you so much in advance! Miguel
tuanphan Posted January 9 Posted January 9 I see you removed button. Do you still need help on this? And change button url only or change button url + rename button text? 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!)
therealmiguel Posted January 9 Author Posted January 9 Hi @tuanphan! Happy New Year to you! I did remove the button as a temporary solution. I'd like to change the button URL and rename the button text. Literally, I'd like for the button to say "Course Login" on that specific page only. Thank you so much for your help! Miguel
Solution tuanphan Posted January 10 Solution Posted January 10 Add this code to Page Header Code Injection to change text + url <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(function(){ $("a.btn").html(function() { return $(this).html().replace("MY THRIVE WITH ADHD COURSE", "new text"); }); $("a.btn").attr('href','https://google.com'); }); </script> Replace new text to text what you want and google with new url 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!)
therealmiguel Posted January 10 Author Posted January 10 That's wonderful, thank you @tuanphan!! It's worked like a charm! I'd quite like to hide the CTA button from the paywall page, but this has no page settings, and hence no page header code injection for me to do that. Any advice on how to do it? The paywall page is https://drmiguelmateas.com/thrive-with-adhd. Thank you again for your help. You rock! Miguel
tuanphan Posted January 11 Posted January 11 Are you able to add a Code Block to page? if yes, you can add code to Code Block. If it doesn't support Code Block, add this code to Website Tools (under Not Linked) > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(function(){ $('#sqs-paywall-page-root').closest('body').addClass('paywall-body'); $("body.paywall-body a.btn").html(function() { return $(this).html().replace("MY THRIVE WITH ADHD COURSE", "new text"); }); $("body.paywall-body a.btn").attr('href','https://google.com'); }); </script> 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!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment