Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/03/2015, 21:32
Burlon23
 
Fecha de Ingreso: marzo-2015
Ubicación: Buenos Aires
Mensajes: 32
Antigüedad: 9 años, 1 mes
Puntos: 0
Información Respuesta: Como mostrar Custom Post Type mediante Custom Fields

Logre solucionarlo asi:

Código PHP:
<?php 


function extracto_noticia($post$length 10$tags '<a><em><strong>'$extra ' . . .') {
 
    if(
is_int($post)) {
        
// get the post object of the passed ID
        
$post get_post($post);
    } elseif(!
is_object($post)) {
        return 
false;
    }
 
    if(
has_excerpt($post->ID)) {
        
$the_excerpt $post->post_excerpt;
        return 
apply_filters('the_content'$the_excerpt);
    } else {
        
$the_excerpt $post->post_content;
    }
 
    
$the_excerpt strip_shortcodes(strip_tags($the_excerpt), $tags);
    
$the_excerpt preg_split('/\b/'$the_excerpt$length 2+1);
    
$excerpt_waste array_pop($the_excerpt);
    
$the_excerpt implode($the_excerpt);
    
$the_excerpt .= $extra;
 
    return 
apply_filters('the_content'$the_excerpt);
}






$posts get_field('nombre_del_campo');

if( 
$posts ): ?>
    <div id="columna_evento_1">

    <div id="div_titulo_noticias_evento">
    <a class="titulo_noticias_evento">Texto</a>
    <?php foreach( $posts as $p ): // variable must NOT be called $post (IMPORTANT) ?>
        <li>
           <a class="titulo_noticia_evento_link" href="<?php echo get_permalink$p->ID ); ?>"><?php echo get_the_title$p->ID ); ?></a>
        <a><?php echo get_the_post_thumbnail$p->ID ); ?></a>
        <p><?php echo extracto_noticia($p); ?></p>
        
        </li>
    <?php endforeach; ?>
    </div>

    </div>
<?php endif;?>
, Lo pude lograr vinculando los Custom Post Type mediante relationship, ahora necesito solo mostrar 3 post relacionados con un "Ver todos los Post relacionados", me dan este código:
Código PHP:
<?php 

// get only first 3 results
$ids get_field('conference_talks'falsefalse);

$query = new WP_Query(array(
    
'post_type'          => 'conferences',
    
'posts_per_page'    => 3,
    
'post__in'        => $ids,
    
'post_status'        => 'any',
    
'orderby'            => 'rand',
));

?>
Pero como les dije soy novato y no se donde introducirlo ni como, espero me puedn ayudar, gracias.