Attractions of Sri Lanka

Cities / Towns
Anuradhapura
Bandarawela 
Colombo
Galle
Jaffna
Kandy
Kilinochchi – Mulativu Route
Kurunegala
Negombo
Polonnaruwa
Trincomalee
All Locations 
[php]
echo “[table class=\”acenter underline-t\” style=\”width: 100%;\” align=\”center\” border=\”0\” cellpadding=\”0\” ]”;
echo “[tbody]”;$i=0;
global $wpdb;
$query = ”
SELECT ID,post_title FROM $wpdb->posts
LEFT JOIN $wpdb->term_relationships ON
($wpdb->posts.ID = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy ON
($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
WHERE $wpdb->posts.post_status = ‘publish’
AND $wpdb->posts.post_type = ‘post’
AND $wpdb->term_taxonomy.taxonomy = ‘category’
AND $wpdb->term_taxonomy.term_id = 343
ORDER BY post_title”;
$results = $wpdb->get_results($query);
$duplicates = array(3988);
foreach($results as $row) {
if (!in_array($row->ID,$duplicates)) {
$gen_line=””;
$i=$i+1;
$c1=”[td]”.str_pad($i,3,”0″,STR_PAD_LEFT).”[/td]”;
$c2=”[td][a href=\”/wp/?p=”.$row->ID.”\”]”.trim($row->post_title).”[/a][/td]”;
$gen_line=$c1.$c2.”\r\n”;
$gen_line=”[tr]”.$c1.””.$c2.”[/tr]”;
echo nl2br($gen_line);
}
}
echo “[/table]”;
echo “[/tbody]”;

[/php]

 

Leave a Reply

Your email address will not be published.

*