Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to do this:

<a href="/wp-login"><span style="pointer-events:none">[shortcode]</span></a>

The Shortcode should be disabled but linked to a loginform.

but wordpress does this:

<a href="/wp-login"></a><span style="pointer-events:none"></span> [shortcode]    

The crazy thing is It worked a few days ago...

If you look here:

http://www.manugoo.com/beta/kaninchenrasierer-4/

the "mitmachen" button is the shortcode and should link to loginform

EDIT

After playing with some functions.php codes I found somewhere this is the output:

<p>
<a class="simplemodal-login" href="/beta/wp-login.php">
<span style="pointer-events:none">  </span>
</a>
</p>
<div class="textwidget">
<a class="read_more" href="http://www.manugoo.com/beta/kaninchenrasierer-4/">Mitmachen!</a>

I tried to insert other shortcodes which has no a-tag inside. Same result.

share|improve this question
    
What's the code for your shortcode handler? –  TheDeadMedic Mar 12 at 11:50
    
I would be glad to give you an aswer, but I don't know exactly what you want to here :) In final version the shortcode should do a gravity form –  Martin Mar 12 at 12:30
    
I've installed the Disable wpautop plugin. The result is that the span is wrapped around the shortcode when i don't put a link around. When I add a link output is like above. –  Martin Mar 12 at 12:39

1 Answer 1

Have you tried:

<?php 
echo '<a href="/wp-login"></a><span style="pointer-events:none">';
echo do_shortcode( '[shortcode]' );
echo '</span></a>'; 
?>

See: http://codex.wordpress.org/Function_Reference/do_shortcode

share|improve this answer
    
Thanks for reply. It works again. The shortcode I tried to wrap the a and span around had Ajax activated. After dissabling Ajax everything was fine. –  Martin Mar 13 at 17:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.