Home › Forums › Back End › Custom field WordPress that will auto-populate from others? › Re: Custom field WordPress that will auto-populate from others?
June 8, 2010 at 4:45 pm
#77371
Member
Well, took me around 4-5 hours but I figured this one out. Used Custom Field Template along with this custom wpdb query:
Code:
get_results(“SELECT ID, post_title
FROM $wpdb->posts
where post_type = ‘schedule’
and post_status = ‘publish’
order by post_date DESC”);
$i = 0;
foreach ($items as $item) {
$values[$i] = $permalink = get_permalink($item->ID);
$valueLabel[$i] = $item->post_title;
$i++;
}
?>
FROM $wpdb->posts
where post_type = ‘schedule’
and post_status = ‘publish’
order by post_date DESC”);
$i = 0;
foreach ($items as $item) {
$values[$i] = $permalink = get_permalink($item->ID);
$valueLabel[$i] = $item->post_title;
$i++;
}
?>
I can explain further if needed! :ugeek: