Trying to get a function working for wordpress. Using a little bit of code. Problems with syntax or something. Code is in wordpress functions.php. Output should be a text link with the product-id in it. So after click on link the url wil be example: http://www.websitenname.com/interesse?id=33
I have tested this code with-in a template (single-product woocommerce) with succes. This should now work in functions.php for another project (using a short-code in a template (wordpress)) Maybe someone know's what I'm doing wrong
function vComp(){
<a class="interessebutton" href="http://www.websitenname.com/interesse?id=<?php echo $product->id; ?>">Interesse</a>
}
add_shortcode( 'vInteresse', 'vComp' );
Hope to learn what I'm doing wrong. Syntax error: syntax error, unexpected 'vInteresse' (T_STRING)