Created
November 9, 2016 12:02
-
-
Save luisfelipe-dev/471fa8aedd5b617f2f427f90778f4110 to your computer and use it in GitHub Desktop.
Shortcodes , Wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Definimos o gatilho 'youtube' para a função 'shortcode_youtube' | |
| add_shortcode('caixa', 'short_code'); | |
| // Função que retorna o HTML pelo Shotcode | |
| function short_code($atts, $content=null) | |
| { | |
| extract( | |
| shortcode_atts( | |
| array( | |
| 'url' => '', | |
| 'title' => '', | |
| 'height' => '', | |
| 'rel' => 0, | |
| 'showsearch' => 0, | |
| 'showinfo' => 0, | |
| ), | |
| $atts | |
| ) | |
| ); | |
| return '<div class="col-md-6"> | |
| <div class="box-diferencial-completo"> | |
| <div style="min-height:'.$height.'px" class="border-box box-diferencial"<p>' | |
| .$content.'</p> | |
| </div> | |
| <img class="img-empresa" src="'.$url.'"alt="'.$title.'"/> | |
| </div> | |
| </div>'; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment