Example #1
0
                break;
            }
        }
        //echo('nav_cat_id: ' .$nav_cat_id);
        $prev = mbudm_get_previous_artwork($post->ID, $nav_cat_id);
        if ($prev) {
            $imgdata = mbudm_get_post_image_tag_and_caption($prev, MBUDM_IMAGESIZE_2);
            $url = add_querystring_var(get_permalink($prev), 'mb_action', 'prev');
            $url = add_querystring_var($url, 'mb_cat', $nav_cat_id);
            $prevMarkup = '<a class="prev" href="' . $url . '" title="Previous Artwork in ' . $nav_cat_term . ': ' . $imgdata['caption'] . '" ><span>' . $imgdata['tag'] . '</span></a>';
        } else {
            $prevMarkup = '';
        }
        $next = mbudm_get_next_artwork($post->ID, $nav_cat_id);
        if ($next) {
            $imgdata = mbudm_get_post_image_tag_and_caption($next, MBUDM_IMAGESIZE_2);
            $url = add_querystring_var(get_permalink($next), 'mb_action', 'next');
            $url = add_querystring_var($url, 'mb_cat', $nav_cat_id);
            $nextMarkup = '<a class="next" href="' . $url . '" title="Next Artwork in ' . $nav_cat_term . ': ' . $imgdata['caption'] . '" ><span>' . $imgdata['tag'] . '</span></a>';
        } else {
            $nextMarkup = '';
        }
        echo $prevMarkup . $nextMarkup;
        ?>
			<div id="artwork-wrap" class="container_24">
<?php 
        $existing_attachments = get_post_meta($post->ID, '_attachments', false);
        $post_attachments = array();
        $thumb_id = get_post_thumbnail_id($post->ID);
        if (is_array($existing_attachments) && count($existing_attachments) > 0) {
            foreach ($existing_attachments as $attachment) {
Example #2
0
function mbudm_get_post_image($pid = null, $image_size = null, $link = false, $gridClass = '')
{
    if ($pid == null) {
        $pid = get_the_ID();
    }
    if ($image_size == null) {
        $image_size = MBUDM_IMAGESIZE_3;
    }
    // find something to use as a description
    $p_title = get_the_title($pid);
    $p_ex = get_the_excerpt();
    $p_desc = $p_ex ? $p_ex : $p_title;
    if ($link) {
        $p_url = get_permalink($pid);
        $url_tag_open = '<a href="' . $p_url . '" title="' . $p_title . '" >';
    } else {
        $url_tag_open = null;
    }
    $imgdata = mbudm_get_post_image_tag_and_caption($pid, $image_size);
    $imgdata['caption'] = $imgdata['caption'] ? $imgdata['caption'] : $p_desc;
    return mbudm_render_image($imgdata, $url_tag_open, $gridClass);
}