User Submitted Posts Plugin
-
Hello Im using the User Submitted Posts plugin to all users to post to the front page.
I use the code below in my content.php to get the pictures to appear too. Its all find when the users submit a photo.
Problem is when the users don’t add a photo, there is a dead link that appears.(you can see this happening here: http://www.breakuppedia.com) Do help me if you can.
Thank you so much!
<?php global $wpdb;
$query = “SELECTID,guidFROM$wpdb->postsWHEREpost_type= ‘attachment’ ANDpost_parent= ‘{$post->ID}'”;
$adimages = $wpdb->get_results($wpdb->prepare($query), OBJECT);
// To display the first image.. ?><img style=”float: left; height: 380px;border: 2px solid #464646;” src=”<?php if(is_public_submission()){echo $adimages[0]->guid;} ?>” />
The topic ‘User Submitted Posts Plugin’ is closed to new replies.