$query='SELECT post_title, post_date, meta_value
FROM wp_posts
INNER JOIN wp_postmeta on wp_postmeta.post_id = wp_posts.id AND meta_key LIKE "_Company"
WHERE post_status="publish"
AND post_type="job_listing"
ORDER BY wp_posts.id DESC
LIMIT 5';
$results=mysql_query($query) or die (mysql_error());
echo "<ul>";
while($row=mysql_fetch_assoc($results)){
$title=$row['post_title'];
$junk=array(',','-',':','/','-');
$title_link=str_replace($junk,'',$title);
$title_link=str_replace(' ','-',$title_link);
$title_link=str_replace('--','-',$title_link);
$title_link=strtolower($title_link);
$timestamp = strtotime($row['post_date']);
$date = date('m.d.y', $timestamp);
$company=$row['display_name'];
echo '<li>';
echo $date;
echo '<a href="http://www.webstite.com/jobs/'.$title_link.'" title="'.$title.'">'.$title.'</a>';
echo $company;
echo '</li>';
}
There are currently 1 users browsing this thread. (0 members and 1 guests)