Skip to content

Instantly share code, notes, and snippets.

@jillmugge
Created April 22, 2014 14:59
Show Gist options
  • Save jillmugge/11182560 to your computer and use it in GitHub Desktop.
Save jillmugge/11182560 to your computer and use it in GitHub Desktop.
Adding Img from PODS via LB
<?php
//adding images from Pods to Loopbuddy
add_shortcode('jmg_custom_image_before', 'get_custom_field_1');
function get_custom_field_1() {
global $post;
return '<a href="'.get_post_meta($post->ID, "before_lightbox.guid", true).'" rel="themeblvd_lightbox[before]" title="'.get_post_meta($post->ID, "before_image_title", true).'"><img src="'.get_post_meta($post->ID, "before.guid", true).'" class="before-image"></a>';
}
add_shortcode('jmg_custom_image_after', 'get_custom_field_2');
function get_custom_field_2() {
global $post;
return '<a href="'.get_post_meta($post->ID, "after_lightbox.guid", true).'" rel="themeblvd_lightbox[after]" title="'.get_post_meta($post->ID, "after_image_title", true).'"><img src="' . get_post_meta($post->ID, "after.guid", true) . '" class="after-image"></a>';
}
add_shortcode('jmg_custom_image_logo', 'get_custom_field_3');
function get_custom_field_3() {
global $post;
return '<img src="' . get_post_meta($post->ID, "logo.guid", true) . '" class="client-logo" />';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment