I want to show a css button and text field in PHP(functions.php of WordPress theme).
I am able to do everything but the issue is just the value="<?php echo wp_get_shortlink(get_the_ID()); ?>"
which does't execute if I use double quotes.
Here is my code:
function add_buttons_filter( $content ) {
$content .= ' <span class="abf">
<span class="abc">
<button class="bcd"><span class="dcb"><span></span></span>
</button>
</span>
<span class="abf">
<span class="abc-main">
<span class="abc-box" style="display:none;">
<input type="text" style=" max-width: 80px;" value="<?php echo wp_get_shortlink(get_the_ID()); ?>" onclick="this.focus(); this.select();" />
</span>
</span>
</span>
</span>';
return $content;
}
add_filter( 'the_content', 'add_buttons_filter' );
Could any one help me or show me a better solution to execute this in functions.php ?