Making first plugin… but it’s not working
-
I’m making a plugin which will give me a list (with images and links) of a few selected authors ordered by the most recent post date… but I only get the image border and link but no author… could someone help me point out what I’m doing wrong here… (not a programmer… built this code by quickly glancing at php and wordpress plugin files)
function pfc_author_list($before = ”, $after = ‘
‘) {global $wpdb;
$pfcrequest = “SELECT $wpdb->users.user_login, $wpdb->posts.post_status, Max($wpdb->posts.post_date) AS ‘pfcpostdate’ FROM $wpdb->users, $wpdb->posts”;
$pfcrequest .= ” WHERE ID IN (’73’,’39’,’52’,’54’,’64’,’60’,’71’,’98’,’134′,’142′,’101′,’141′,’144′) AND $wpdb->users.ID=$wpdb->post.post_author AND $wpdb->post.post_status = ‘publish'”;
$pfcrequest .= ” GROUP BY $wpdb->users.user_login ORDER BY pfcpostdate DESC”;
$pfclist = $wpdb->get_results($request);
$pfcoutput = ”;
if ($pfclist) {
foreach ($pfclist as $pfclist) {
$pfcauthor = $pfclist->user_login;
$pfcauthorlink = ‘<
a href="https://passionforcinema.com/author/' . $pfcauthor. '" title="Click here to read the diary of ' . $pfcauthor. '"
><img src="https://passionforcinema.com/images/' . $pfcauthor. '.jpg" style="border:solid #0B256F 1px;" /
></a
>’;$pfcoutput .= $before . $pfcauthorlink . $after;
}
} else {
$pfcoutput .= $before . “None found” . $after;
}
echo $pfcoutput;
}
- The topic ‘Making first plugin… but it’s not working’ is closed to new replies.