• Resolved breakuppedia

    (@breakuppedia)


    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 = “SELECT ID, guid FROM $wpdb->posts WHERE post_type = ‘attachment’ AND post_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;} ?>” />

Viewing 10 replies - 31 through 40 (of 40 total)
Viewing 10 replies - 31 through 40 (of 40 total)

The topic ‘User Submitted Posts Plugin’ is closed to new replies.