M
Marii26
Gamma
Verificado por Whatsapp
Encontré un código que promete hacer que tu contenido se muestre en dos columnas diferentes, es este:
Este va en en el fichero functions.php de tu plantilla (theme):
Y este en el fichero style.css de tu plantilla (theme):
Sin embargo no logro hacer que funcione, y me preguntaba si alguien sabía cómo editar este aspecto de una plantilla WordPress.
Muchas gracias de antemano
Este va en en el fichero functions.php de tu plantilla (theme):
Insertar CODE, HTML o PHP:
function my_multi_col($content){
$columns = explode('<h2>', $content);
$i = 0;
foreach ($columns as $column){
if (($i % 2) == 0){
$return .= '<div class="content_left">' . "\n";
if ($i > 1){
$return .= "<h2>";
} else{
$return .= '<div class="content_right">' . "\n <h2>";
}
$return .= $column;
$return .= '</p></div>';
$i++;
}
if(isset($columns[1])){
$content = wpautop($return);
}else{
$content = wpautop($content);
}
echo $content;
}
add_filter('the_content', 'my_multi_col');
Y este en el fichero style.css de tu plantilla (theme):
Insertar CODE, HTML o PHP:
.content_right, .content_left{
float:left;
width:45%;
}
.content_left{
padding-right:5%;
}
Sin embargo no logro hacer que funcione, y me preguntaba si alguien sabía cómo editar este aspecto de una plantilla WordPress.
Muchas gracias de antemano