shortcodes para inserir duas imagens
-
Inseri no meu tema o código abaixo para inserir shortcode de uma imagem, preciso carregar 3 imagens ao invés d euma só, como devo proceder?
Obrigadofunction image_shortcode($atts, $content = null) {
extract( shortcode_atts( array(
‘name’ => ‘cliente’,
‘align’ => ‘left’,
‘ext’ => ‘png’,
‘path’ => ‘/wp-content/uploads/’,
‘url’ => ”
), $atts ) );
$file=ABSPATH.”$path$name.$ext”;
if (file_exists($file)) {
$size=getimagesize($file);
if ($size!==false) $size=$size[3];
$output = “<img src='”.get_option(‘siteurl’).”$path$name.$ext’ alt=’$name’ $size align=’$align’ class=’align$align’ />”;
if ($url) $output = ““.$output.’‘;
return $output;
}
else {
trigger_error(“‘$path$name.$ext’ image not found”, E_USER_WARNING);
return ”;
}
}
add_shortcode(‘cliente’,’image_shortcode’);
- O tópico ‘shortcodes para inserir duas imagens’ está fechado para novas respostas.