I’m trying to open the user_url within an iframe on a private user page in WordPress.
I put the following code into a snippet:
<?php echo get_the_author_meta('user_url',$userID); ?>
When I use the short code on the user page it does display the user URL, I can also use it in an hyperlink like this:
<a href="[cmruncode name='dash']">link text</a>
But when I put the short code into an Iframe the short code does not change into the URL anymore.
<iframe src="[cmruncode name='dash']" height="300" width="300" title="Iframe"></iframe>
Does anyone knows why this is not working and know a solution?
Thanks Peter
3
Answers
This only works when I put it directly into the template, in that case no snippet-shortcode is needed at all. But the content needs to be hidden when the user is logged-out.
Normally the plugin "client portal" that I use should take care of this but it has a content block that does not support PHP and also does not render the php snippet that I made.
Any suggestions?
If you are using WordPress shortcode then you have to call shotcode using function
do_shortcode
.You can try this one
And I’m not sure why anchort text display right output. That’s weird.
Anyway if you used
do_shortcode
to output your shortcode then it will work every place.The solution was to put the iframe code completely into a snippet.
Like this: