Archived topic
One Shortcode Doesn't work
7 replies · Started by Samuel on June 11, 2021
Hi Team,
I have created a shortcode, which is not working. But other custom shortcodes working perfectly.
I just showing you my shoercode codes:
function dl_minti_button_shortcode($atts, $content = '') {
extract( shortcode_atts(
array(
'link' => '#',
'target' => '_blank',
'lightbox' => '',
'color' => '',
'icon' => ''
), $atts )
);
ob_start();
?>
<div class="minti_butto_wrap">
<a href="<?php echo $link; ?>" target="<?php echo $target; ?>"><?php echo $content; ?></a>
</div>
<?php
return ob_get_clean();
}
add_shortcode( 'minti_button', 'dl_minti_button_shortcode' );
I have applied this shortcode in this page https://justcreative.com/shortcode-test-page/
But showing me plain shortcode text. See screenshot http://i.prntscr.com/8Dm_8e8bRRixNvkW2IqMgQ.png
So, please me how can I solve this problem.
Hi there,
i just tested the shortcode in the Block editor using the Shortcode Block and it returns the correct HTML.
How is the shortcode being added to the site ?
I added shortcode codes inside functions.php file.
And I added this shortcode
[minti_button link="https://www.designcuts.com/product/female-crop-top-t-shirt-mockup/?ref=jacobcass&tap_s=1827493-03df7e" target="_blank"]Download Now[/minti_button]
But showing me shortcode text at forntend.
In the post editor - how is it added? Are you using the Block Editor ? If so it should go in the Short Code block.
No, I used text editor.
Can't see how this would be theme issue as it's a custom function/shortcode.
Does it work in a shortcode block?
And does it work in a Twenty series WP theme?
Other shortcodes working fine. Just problem with this shortcode [minti_button]
I would say that the shortcode itself is the issue - the theme itself has no way of stopping a shortcode from working.
Have you tested with a Twenty series WP theme?