• Resolved zinc1314

    (@zinc1314)


    Hi!

    I’m desperated! The first data works, but second (src or url) don’t work!

    I created this shortcode:

    // shortcode [facebook]
    function show_facebook( $atts ){
      extract( shortcode_atts( array(
                    'show' => 'YES',
                    'src' => '#',
           ), $atts));
    
        $salida = '<div id="divminiright" class="' .$show. '"><a href="' .$src. '" target="_blank"><div id="minifacebook"></div></a></div>';
        return $salida;
    }
    //add our shortcode telefono
    add_shortcode('facebook', 'show_facebook');

    and write on post

    [facebook show="YES" src="https://www.facebook.com/user1312"]

Viewing 1 replies (of 1 total)
  • Thread Starter zinc1314

    (@zinc1314)

    Here work it!

    // shortcode [facebook]
    function mostrar_facebook($atts, $content = null) {
       extract(shortcode_atts(array('link' => '#','mostrar' => 'SI'), $atts));
       return '<div id="divminiright" class="' .$mostrar. '"><a href="' .$link. '" target="_blank"><div id="minifacebook"></div>' . do_shortcode($content) . '</a></div>';
    }
    add_shortcode('facebook', 'mostrar_facebook');
Viewing 1 replies (of 1 total)
  • The topic ‘facebook shortcode with class’ is closed to new replies.