-
AuthorPosts
-
June 16, 2021 at 11:39 pm #1306100
Hi,
I found mamy posts about changing “Blog -Latest news” name or hide it or link to a post title.
But I’d like to leave it as it is, but change the site where it linking to.
How to do it?Regards!
June 19, 2021 at 4:57 pm #1306514Hey kwlodar,
Thank you for your patience, when you say:change the site where it linking to
do you mean redirect to a different domain, or do you mean change the page on the same site?
To change the page on the same site please adjust the Theme Options:
If you want to change the url of the link only for the title, perhaps to a different domain, then try adding this code to the end of your functions.php file in Appearance > Editor:function custom_script() { ?> <script> (function($){ $(".main-title > a[href^='https://kriesi.at/themes/enfold/blog/']").prop("href", "https://google.com") })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
In the above code you will note the class .main-title, this is added so any menu links to the page will not be changed, then the next part of the code is the title link you want to change, then the last part is the link you want it to be.
If you have any problems getting this to work then please link to the page and let us know where you want the link to point to.Best regards,
MikeJuly 12, 2021 at 9:45 am #1309701Hi Mike,
thank you for your answer. Probably I wasn’t clear enough.
I’d like to change the link (url) showing in each blog post header (ex.: https://www.sensity.pl/usmiechnieta-depresja-co-to/) not to point to the main site, but to https://www.sensity.pl/blog/https://snipboard.io/NQskje.jpg
Thank you for your help!
ChrisJuly 12, 2021 at 11:34 am #1309730Hi,
Thank you for the feedback, try adding this code to the end of your functions.php file in Appearance > Editor instead:function custom_single_to_blog_script() { ?> <script> window.addEventListener('DOMContentLoaded', function() { (function($){ $("#top.single-post .main-title > a[href^='https://www.sensity.pl/']").prop("href", "https://www.sensity.pl/blog/") })(jQuery); }); </script> <?php } add_action('wp_footer', 'custom_single_to_blog_script');
Best regards,
MikeJuly 12, 2021 at 2:07 pm #1309781Works – thank you so much!
ChrisJuly 12, 2021 at 2:22 pm #1309788Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘Change link of Blog – Latest news at the top of posts’ is closed to new replies.