Shortcode does not output anything. Why?
-
Hi,
I want to insert the URL of the current post. So I add a code snippet as follows:
<a href="<?php echo esc_url(get_permalink()); ?>" target="_blank" rel="noopener"><?php echo esc_url(get_permalink()); ?></a>
Then I set its type to “Universal Snippet” since it is a mix of the HTML and php code.
Then I choose “ShortCode” as the insert method, and it generates a shortcode as below:
[wpcode id=”53103″]
So I just put the shortcode in a post, as below:
The URL of the current post is: [wpcode id="53103"]
However, after loading the post https://www.sybase-recovery.com/blogs/show-post-url-test/, nothing appear. Why?
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Shortcode does not output anything. Why?’ is closed to new replies.