Jump to content

Changing Blog Author Link

Recommended Posts

Site URL: https://chiroup.com/

Right now when you click on the authors of my blogs it redirects to our blog home page. I'm wanting to change the link to something else. I have 2 main authors. And these are the links I want to change them to. Let me know thanks!

Blog post with Tim Bertelsman: https://chiroup.com/blog/7-new-skills-for-carpal-tunnel-syndrome | Author link should be: https://chiroup.com/dr-bertelsman

Blog post with Brandon Steele: https://chiroup.com/blog/chiropractic-evaluation-of-neurologic-heel-pain | Author link should be: https://chiroup.com/dr-steele

Link to comment

Try adding this code 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() {
	$('a.blog-author-name[href*="851a68"]').attr('href','/dr-bertelsman');
  	$('a.blog-author-name[href*="851a6a"]').attr('href','/dr-steele');
});
</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!)

Link to comment
On 3/25/2022 at 8:35 PM, tuanphan said:

Try adding this code 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() {
	$('a.blog-author-name[href*="851a68"]').attr('href','/dr-bertelsman');
  	$('a.blog-author-name[href*="851a6a"]').attr('href','/dr-steele');
});
</script>

 

How do you make this open up in a new tab? 

target="_blank"  

This doesnʻt seem to work no matter where I paste it in. My link is already supposed to be a redirect into a new tab but it doesnʻt work, and I canʻt get this to work either.

Thanks

Edited by noahawaii
Link to comment
On 3/27/2022 at 2:39 PM, noahawaii said:

How do you make this open up in a new tab? 

target="_blank"  

This doesnʻt seem to work no matter where I paste it in. My link is already supposed to be a redirect into a new tab but it doesnʻt work, and I canʻt get this to work either.

Thanks

Try this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
   setTimeout(function(){
            	$('a.blog-author-name[href*="851a68"]').attr('href','/dr-bertelsman');
  	$('a.blog-author-name[href*="851a6a"]').attr('href','/dr-steele');
     $('a.blog-author-name').attr('target','_blank');
         }, 2000);
});
</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!)

Link to comment
On 3/26/2022 at 1:35 AM, tuanphan said:

Try adding this code 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() {
	$('a.blog-author-name[href*="851a68"]').attr('href','/dr-bertelsman');
  	$('a.blog-author-name[href*="851a6a"]').attr('href','/dr-steele');
});
</script>

 

This worked for the top of the post where it says "written by" but when you click on the profile picture at the bottom of the blog it still takes you to the blog page.

Link to comment
On 3/31/2022 at 3:03 AM, ChiroUp said:

This worked for the top of the post where it says "written by" but when you click on the profile picture at the bottom of the blog it still takes you to the blog page.

Ah, I didn't notice profile picture on the bottom

Use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
   setTimeout(function(){
            	$('a.blog-author-name[href*="851a68"], .blog-item-author-profile-wrapper a[href*="851a68"]').attr('href','/dr-bertelsman');
  	$('a.blog-author-name[href*="851a6a"], .blog-item-author-profile-wrapper a[href*="851a6a"]').attr('href','/dr-steele');
     $('a.blog-author-name, .blog-item-author-profile-wrapper a').attr('target','_blank');
         }, 2000);
});
</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!)

Link to comment
  • 2 months later...
On 4/2/2022 at 1:24 AM, tuanphan said:

Ah, I didn't notice profile picture on the bottom

Use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
   setTimeout(function(){
            	$('a.blog-author-name[href*="851a68"], .blog-item-author-profile-wrapper a[href*="851a68"]').attr('href','/dr-bertelsman');
  	$('a.blog-author-name[href*="851a6a"], .blog-item-author-profile-wrapper a[href*="851a6a"]').attr('href','/dr-steele');
     $('a.blog-author-name, .blog-item-author-profile-wrapper a').attr('target','_blank');
         }, 2000);
});
</script>

 

Hi @tuanphan - very interested to implement this as well, although this code is not working for me.

I think it may be the 'blog-author-name' - where do I get this unique code from? I've tried using the code at the end of the URL that's linked from the profile pic and name, but it's much longer: '61b6b8c8a521551d9947b0a6'

Site: www.southsidelegal.com.au

Link to comment
54 minutes ago, julia1 said:

Hi @tuanphan - very interested to implement this as well, although this code is not working for me.

I think it may be the 'blog-author-name' - where do I get this unique code from? I've tried using the code at the end of the URL that's linked from the profile pic and name, but it's much longer: '61b6b8c8a521551d9947b0a6'

Site: www.southsidelegal.com.au

Can you share link to a blog post?

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
  • 11 months later...
18 hours ago, TomBatch said:

Hey @tuanphan I would love this on my site, but I am struggling to find the code too.

I would love the Author link to link back to https://www.batchcoffee.co.uk/tom-saxon-coffee-expert

Here is my site and blog:

https://www.batchcoffee.co.uk/stories

THanks 🙂

Tom.

You mean change all author on this page to above link?

image.thumb.png.a179e2f517209ce0d7d9a202445703e8.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
23 hours ago, TomBatch said:

To be honest there is only one author. So I will change it shortly so all the blogs are written by 'Tom Saxon - Coffee Expert'. 

I would then like the link to go to: https://www.batchcoffee.co.uk/tom-saxon-coffee-expert

instead of: https://www.batchcoffee.co.uk/stories#:~:text=Tom Saxon - Coffee Expert

Add to Last Line in Code Injection > Footer

<script>
$(document).ready(function() {
   setTimeout(function(){
            	$('a.Blog-meta-item--author').attr('href','https://www.batchcoffee.co.uk/tom-saxon-coffee-expert');
         }, 2000);
});
</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!)

Link to comment
23 hours ago, TomBatch said:

Yeah, I did try that and it does work on the blog list page, however not so great on individual blog pages. I would prefer to keep Ajax loading on as I have some pretty large blog posts. Is there a work around with this?

Thanks again 🙂

You try creating a new thread. I am not very familiar with Ajax Code. Hope someone can rewrite that code to work with Ajax

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

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.