How do I Change Logo link URL? NOT Home Page…

This topic has 6 replies, 2 voices, and was last updated 6 months ago ago by Luca Rossi

  • Avatar: Roobinda
    Roobinda
    Participant
    May 15, 2024 at 11:18

    Hi there. To achieve this you gave me the code below. However, this is no longer working! Any idea why?

    
    add_action('wp_footer', 'n2t_wp_footer', 99);
    function n2t_wp_footer() {
    	if(is_singular('product')){
    	?>
    	<script>
    		!function($) {
    			"use strict";
    			$(document).ready(function(){
    				$(".et_b_header-logo > a").attr('href', 'https://yourcustomlink.com');
    			});
    		}(jQuery);
    	</script>
    	<?php
    	}
    }
    
    5 Answers
    Avatar: Justin
    Luca Rossi
    Support staff
    May 15, 2024 at 11:42

    Hi @Roobinda,

    The custom codes are working for the Product pages only.

    Do you want to make it work for all the pages?

    Best Regards,
    8Theme’s Team

    Avatar: Roobinda
    Roobinda
    Participant
    May 15, 2024 at 16:19

    Oh I can see that now. Yes, I need it to work for every page…

    Avatar: Justin
    Luca Rossi
    Support staff
    May 15, 2024 at 16:25

    Hi @Roobinda,

    Please use this code instead, we’ve updated the codes to make it work for all pages:

    
    add_action('wp_footer', 'n2t_wp_footer', 99);
    function n2t_wp_footer() {
    	?>
    	<script>
    		!function($) {
    			"use strict";
    			$(document).ready(function(){
    				$(".et_b_header-logo > a").attr('href', 'https://yourcustomlink.com');
    			});
    		}(jQuery);
    	</script>
    	<?php
    }
    

    Hope it helps!

    Avatar: Roobinda
    Roobinda
    Participant
    May 15, 2024 at 16:31

    Perfect! Thank you.

    Avatar: Justin
    Luca Rossi
    Support staff
    May 15, 2024 at 16:42

    Glad we’re able to help you!

    Best Regards,
    8Theme’s Team

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.