post-test

[insert_php]

$sql = ‘select post_content,post_title, post_name,guid,imagen, id, colaborador, colaborador2,colaborador3 from wp_posts where post_type=”post” and tipo=”post” and post_status=”publish” and id in (SELECT object_id FROM wp_term_relationships tr, wp_term_taxonomy tt, wp_terms t where t.term_id=tt.term_id and tt.term_taxonomy_id=tr.term_taxonomy_id and taxonomy=”category”)order by post_date DESC LIMIT 0,4’;
$result = mysql_query(“$sql”);
if (!$result) {
echo ‘No se pudo ejecutar la consulta: ‘ . mysql_error();
exit;
}

/*
imagen:
$enlace=’https://africaactual.com/’.$row[2];
enlace:$enlace
titulo: $row[1]
$row[0]=strip_tags($row[0]);
echo substr($row[0],0,201).’ …
‘;

Ver más

*/
while ($row = mysql_fetch_row($result) ){

$colaborador=””;
$colaborador2=””;
$colaborador3=””;
if($row[6]){
$sql2=’select post_title,post_name from wp_posts where id=”‘.$row[6].'”‘;
$result2=mysql_query(“$sql2”);
while($row2=mysql_fetch_row($result2)){
$colaborador=’‘.$row2[0].’‘;
}
}

if($row[7]){
$sql3=’select post_title,post_name from wp_posts where id=”‘.$row[7].'”‘;
$result3=mysql_query(“$sql3”);
while($row3=mysql_fetch_row($result3)){
$colaborador2=’‘.$row3[0].’‘;
}
}

if($row[8]){
$sql4=’select post_title,post_name from wp_posts where id=’.$row[8];

$result4=mysql_query(“$sql4”);
while($row4=mysql_fetch_row($result4)){
$colaborador3=’‘.$row4[0].’‘;
}
}

$enlace=’https://africaactual.com/’.$row[2];
echo “

“;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘‘;
echo ‘

‘;
echo ‘

‘.$row[1].’

‘;
echo ‘

‘;
if(!empty($colaborador)){
echo “Por $colaborador”;
}
if(!empty($colaborador2)){
echo “, $colaborador2″;
}
if(!empty($colaborador3)){
echo ” y $colaborador3″;
}

echo ‘

‘;

echo ‘

‘;
echo ‘

‘;
}
[/insert_php]