• Resolved awx2d

    (@awx2d)


    Hi I am using the code developed by theundersigned to build the xml doc for a number of slideshow pro gallerys, the script is below, I want to pull out a custom field from each post to be used as the gallery image, any help or advise on this would be greatly appreciated!

    <?php
    require('./wp-config.php');
    header('Content-type: text/xml; charset=utf-8'); 
    
    function ssp_fetch_images($postid, $size) {
        global $wpdb;
        return $wpdb->get_results("SELECT guid, post_title, post_content FROM $wpdb->posts WHERE post_parent = $postid AND post_mime_type = 'image/jpeg'");
    } 
    
    if(isset($_GET['cat'])) {
    $cat = $_GET['cat'];
    $query = "cat=$cat&showposts=1000";
    } else {
    $query = "showposts=1000";
    } ?>
    <gallery>
        <?php $gallery = new WP_Query($query);
        while ($gallery->have_posts()) : $gallery->the_post(); ?>
        <album title="<?php echo htmlspecialchars($post->post_title); ?>" description="<?php echo htmlspecialchars($post->post_content); ?>">
            <?php $images = ssp_fetch_images($post->ID);
            foreach($images as $image) { ?>
            <img src="<?php echo $image->guid; ?>" tn="<?php echo str_replace(".jpg", ".thumbnail.jpg", $image->guid); ?>" title="<?php echo htmlspecialchars($image->post_title); ?>" caption="<?php echo htmlspecialchars($image->post_content); ?>" />
            <?php } ?>
        </album>
        <?php endwhile; ?>
    </gallery>
Viewing 1 replies (of 1 total)
  • Thread Starter awx2d

    (@awx2d)

    Just to clarify as no replies seem to be forthcoming .. while the title specifies SSP this is more custom scripting for pulling specific information from a post in order to make an XML file.

    I have tried the get_post_meta function but I’m either not configuring it correctly or it wont work here, any help would be greatly appreciated

Viewing 1 replies (of 1 total)
  • The topic ‘Slideshowpro & WordPress’ is closed to new replies.