Why this is show me nothing??
I’m totally lost =(
<?php function calc_shortcode(){ ?>
<div>
<form>
<h3>Price High</h3>
<input name="priceHigh" type="text" />
<h3>Price Low</h3>
<input name="priceLow" type="text" />
<h3>Price Up</h3>
<input name="priceUp" type="text" />
<h3>Price Down</h3>
<input name="priceDown" type="text" /></br>
<input name="submit" type="submit" value="Calculate" class="btn btn-primary" />
</form>
</div>
<?php
}
add_shortcode('calc_pat', 'calc_shortcode');
Thanks for helping guys!
4
Answers
The php labels are wrongly placed there, try doing this:
Check if that works
Please give try to below code, it should work:
you can also add ob_start(); and ob_get_clean();
To use shortcode you need to call it. Read more here https://developer.wordpress.org/reference/functions/add_shortcode/ and https://developer.wordpress.org/reference/functions/do_shortcode/
Try below code :