-
Hi.
I need to use a shortcode in a hyperlink like so: Buy Nerium ADWhen I do this the script adds a <span> tage to my link.
How can we fix this?Thank you!
BrentThis is what I need:
<a href="http://www.nerium.com/Customers.aspx?ID=[nerium_user_name]" target="_blank">Buy Nerium AD</a>
I end up with this:
<a href="http://www.nerium.com/Customers.aspx?ID=<span class=" up-nerium_user_name">brents" target="_blank”>Buy Nerium AD</a>
This does NOT work either:
<a href="http://www.nerium.com/Customers.aspx?ID=[profile_by_url][nerium_user_name][/profile_by_url]" target="_blank">Buy Nerium AD</a>
Same result as above!This can’t be done. You can’t use a shortcode in hyperlink. Tell me what do you want to achieve and I can give you another way to do it?
Thanks for the reply!
I have been doing this with a different plugin but I could only use 1 name per site. (See:My Company Menu) in the repository: http://wordpress.org/plugins/my-company-menu/<a href="http://www.nerium.com/Customers.aspx?ID=brents" target="_blank">Buy Nerium AD</a>
Each member has their own unique .aspx?ID= like you see above, mine is brents. I created a new field for each member: [nerium_user_name] There are multiple links that I have to use for each member.
Ahmed, my entire site revolves around these hyperlinks. There has to be a way to do this or I’m totally dead in the water.
How else can we do this? Can you remove the
<span> tags
?Please reply ASAP.
Thank you,
BrentNot working. Also tried:
<?php echo userpro_profile_data('nerium_user_name', 75); ?>
and<?php echo do_shortcode('nerium_user_name', 75); ?>
I dunno man, this is way outside the scope of the plugin anyway, you need to hire someone.
Thanks Andy for trying. I have created a work around for doing this anyway, I just need the ability to display any shortcode from the plugin in a sidebar.
this is pretty easy if you even bit know wp and php.
This doesnt work because you trying to execute UserPro code in not userpro plugin.You should use regular WP function.
75 – is user id, and second parameter is your wanted field internal name.
<?php echo get_user_meta( 75, "nerium_user_name", true ); ?>
i didn’t test it but should work.
PS> people stop making topics for such questions..this is not plugin related… You hould hire someone or digg deeper to wp. People flooded this orum with questions, and this forum is for HOW to tutorials, not questions 🙂
^Tomas’s code should work.
Shortcodes won’t work unless they’re inside a page or post published from the backend, or unless they’re wrapped in php tags, and like Tomas said, this is not related to usepro but a wordpress function anyway.
You must be logged in to reply to this topic.