So I have other short codes that are built in this fashion and I cant figure out what i did between them and this one, This short code is used as such: [code code="function(){}"] to wrap your input in <code></code> tags, great for something super simple.

the issue is:

function aisis_inline_code($atts, $content = null){
    extract (
        shortcode_atts (
            array (
                'code' => 'test?'
    return '<code>'.$code.'</code>';

add_shortcode( 'code', 'aisis_inline_code');

The above renders out test wrapped in code tags instead of the content I put in which is: [code code="function(){}"]

How do we debug these? This was working pre WordPress 3.7.1, not it seems all it wants to do is out put test?. I checked the spelling of the short code spelling a hundred times. ...

  • a copy/paste of your code and example shortcode work as expected for me. – Milo Oct 31 '13 at 19:52

I checked your solution (copy and paste) and it is working fine in Wordpress 3.7.1 Maybe check your post again. Can you provide a link to your site? (can not comment yet, thats why I answer)

  • @TheWebs It works fine for me too tested in Wordpress 3.7.1 – Rahil Wazir Oct 31 '13 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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