Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/05/2015, 11:48
StarClown
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Como unificar "the_content" en mi sitio WordPress

Cita:
Iniciado por ArturoGallegos Ver Mensaje
debes utilizar un filtro para unir los contenidos....

aquí tienes la documentación
http://codex.wordpress.org/Plugin_AP...ce/the_content
Lo dicho, aqui vengo con el intento que hice para crear un filtro... podrian alguien decirme que hice mal aqui? Mil gracias.

Código PHP:
<?php
add_filter
( 'the_content', 'all_content_filter', 1 );

function 
all_content_filter( $mycontent ) {

if (
$ingredients != '') {
        
add_filter( 'para_filter', 'wpautop' );
        echo 
apply_filters( 'para_filter', $ingredients );}
                                
        else {
            <
p><?php _e("No se han publicado ingredientes aun", "ingredients")?></p>
            }

if ($post->post_content != '') {
                                                            the_content(); }
        else {
            <p><?php _e("No se ha publicado el procedimiento aun", "ingredients")?></p>
            }
    // Returns the content.
    return $mycontent;
}
?>

Última edición por StarClown; 31/05/2015 a las 11:59