Add action before masthead end

Hi,
im trying to add a usp bar onto a woocommerce x theme, with the below code. But i cannot seem to get it working, is there something i’m missing.

<div id="usp"> </div>
<?php }
add_action( 'x_before_masthead_end', 'usp', 10, 3);

Thanks for help in advance

Hi @aihsan,

Sure we can give you an idea of how to do that. WordPress hooks require you to pass a function. The system holds onto that function until the point that that hook is encountered, then all attached functions are run. Try something like this:

 add_action( 'x_before_masthead_end', function() { ?>  
  <div id="usp"> </div>
<?php });

Hey @alexander

Thats not worked…Is this a bug with new release ?

Hi Aihsan,

The code from Alexander was working fine on my end when I test it on my staging environment.

Child theme functions.php

Front end:

If you can’t still see it on your website, we need to check your wp dashboard. Please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

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