Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/11/2013, 14:16
Avatar de AlejandroGalvez
AlejandroGalvez
 
Fecha de Ingreso: noviembre-2013
Mensajes: 189
Antigüedad: 10 años, 6 meses
Puntos: 49
Respuesta: Modificar una sección de videos relacionados (pasar de categorias a tags)

Código PHP:
function listar_aleatorio$total$id NULL$tipo 1$recortartitulo 100$recortardescripcion 200)  {

    
$listado            '';
    
$tags            '';
    
$upload_dir    wp_upload_dir();
    
    foreach( ( 
get_the_tags$id ) ) as $tag ) { 

        
$tags    .= $tag->name ','

    }


    
$my_query2 = new WP_Query'posts_per_page=' $total '&ignore_sticky_posts=1&orderby=rand&tag=' $tags ); 
Listo para copiar y pegar. Solo era cambiar un par de palabras:

http://codex.wordpress.org/Function_Reference/get_the_tags