Using child theme functions.php to overwrite plugin modal action with link
Just working through a theme that i got with an added plugin. Iv made a number of changes already and have a handful left. These are mainly to do with the plugin.
So currently on the product page i have a Get Now button. This Get Now button when clicked by default opens up a modal pop up for users to login or register. I want to remove that and send users to the checkout page. Current set up:
<div class="btn-and-font" data-target=".i-am-the-modal-login" modal="login">
<span>Get Now</span>
I was initially thinking of setting up another plugin, copy and pasting, then overwriting the class in the file (dont know if thatll work) – but thought could i get away with sorting out in the child theme functions.php.
I was thinking could i hook into wp_head and overwrite that div class and replace the data-target with an ahref /checkout – action hook?
Am i thinking in the right direction and could i overwrite an existing class and / or add a link into an on page element using the child theme?
Leave an answer