Cita:
Utilizo la base de datos de wordpress el resto es personalizado, tengo un gran problema cuando quiero agregar una variable nueva con meta_value no me deja ya puse el de imagen que me asigna una imagen en cada post, pero al agregar ejemplo año y categoria como lo haria? porque ya esta ocupado $imagen=$row1['meta_value']; yo pensaba que solo era agregar otro t1.meta_key = 'thumbnail' pero con la key ano pero no me muestra nada si me puedenayudar se los agradezco gracias. if ($pag) {
$total = $pag * 10;
$pagx = $total - 10;
$peliculas=mysql_query("SELECT t1.post_id AS post_id, t1.meta_key AS meta_key, t1.meta_value AS meta_value, t2.ID AS ID, t2.post_type AS post_type, t2.post_title AS post_title, t2.post_date AS post_date, t2.post_name AS post_name, t3.meta_key AS meta_key, t3.meta_value AS anio FROM utf8postmeta AS t1 INNER JOIN utf8posts AS t3 ON (t1.meta_key = 'thumbnail' && t3.meta_key = 'ano' && t2.post_type = 'post' && t1.post_id = t2.ID) WHERE post_status= 'publish' ORDER BY t2.post_date DESC limit $pagx,10",$conexion);
} else {
$peliculas=mysql_query("SELECT t1.post_id AS post_id, t1.meta_key AS meta_key, t1.meta_value AS meta_value, t2.ID AS ID, t2.post_type AS post_type, t2.post_title AS post_title, t2.post_date AS post_date, t2.post_name AS post_name FROM utf8postmeta AS t1 INNER JOIN utf8posts AS t2 ON (t1.meta_key = 'thumbnail' && t2.post_type = 'post' && t1.post_id = t2.ID) WHERE post_status= 'publish' ORDER BY t2.post_date DESC limit 10",$conexion);
}
$i=0;
while($row1 = mysql_fetch_assoc($peliculas)) {
$titlee = utf8_encode($row1['post_title']);
$imagen = $row1['meta_value'];
$date = $row1['post_date'];
$dire = $row1['post_name'];
$ano = $row1['anio'];
if ($i <= 7) {
$total = $pag * 10;
$pagx = $total - 10;
$peliculas=mysql_query("SELECT t1.post_id AS post_id, t1.meta_key AS meta_key, t1.meta_value AS meta_value, t2.ID AS ID, t2.post_type AS post_type, t2.post_title AS post_title, t2.post_date AS post_date, t2.post_name AS post_name, t3.meta_key AS meta_key, t3.meta_value AS anio FROM utf8postmeta AS t1 INNER JOIN utf8posts AS t3 ON (t1.meta_key = 'thumbnail' && t3.meta_key = 'ano' && t2.post_type = 'post' && t1.post_id = t2.ID) WHERE post_status= 'publish' ORDER BY t2.post_date DESC limit $pagx,10",$conexion);
} else {
$peliculas=mysql_query("SELECT t1.post_id AS post_id, t1.meta_key AS meta_key, t1.meta_value AS meta_value, t2.ID AS ID, t2.post_type AS post_type, t2.post_title AS post_title, t2.post_date AS post_date, t2.post_name AS post_name FROM utf8postmeta AS t1 INNER JOIN utf8posts AS t2 ON (t1.meta_key = 'thumbnail' && t2.post_type = 'post' && t1.post_id = t2.ID) WHERE post_status= 'publish' ORDER BY t2.post_date DESC limit 10",$conexion);
}
$i=0;
while($row1 = mysql_fetch_assoc($peliculas)) {
$titlee = utf8_encode($row1['post_title']);
$imagen = $row1['meta_value'];
$date = $row1['post_date'];
$dire = $row1['post_name'];
$ano = $row1['anio'];
if ($i <= 7) {
Saludotes.