Configuring a jquery hyperlink

Hi there. Just a quick question. I have custom headers for different sections of the website but 1 group of pages require a unique url link to an external site. Would you be able to advise how i would include a directive for the following so this page links elsewhere. Thanks in advance.

jQuery(".page-id-74 .x-brand img").attr(“src”,“https://veganexpo.co.nz/wp-content/uploads/2018/05/chch_veganbackground-1.jpg”);

Hi,

Thanks for writing in!

You can try this js code.

jQuery(".page-id-74 .x-brand").attr("href","https://google.com");

Change https://google.com with your url link.

Hope that helps

Thanks but that doesn’t appear to work. Should it be wrapped together?

Hey @mediarevolution_nz,

The code @paul.r gave works on my end. Try checking if you have the selector page-id-74 matches your page class and ensure there’s not syntax error. You can test your JS code in sites like https://www.jslint.com/.

Regretfully, we do not support issues related to custom codes so we could not continue on providing recommendation for this issue. If it still does not work in your site, you should consult with a web developer.

Thank you for understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.