if(isset($_GET['getID'])){
require_once("wp-config.php");
$id = intval($_GET['getID']);
if($id){
$post = get_post($id);
if(get_field('foto1')!= '')echo '<div class="col-lg-3 col-md-3 col-sm-3"><img class="img-responsive" src="' . esc_attr(get_field('foto1')) . '"></div>';
if(get_field('foto2')!= '')echo '<div class="col-lg-3 col-md-3 col-sm-3"><img class="img-responsive" src="' . esc_attr(get_field('foto2')) . '"></div>';
if(get_field('foto3')!= '')echo '<div class="col-lg-3 col-md-3 col-sm-3"><img class="img-responsive" src="' . esc_attr(get_field('foto3')) . '"></div>';
}
}
AJAXified call to display images from outside of WP, reading out custom fields and displaying them accordingly. Simple and easy. This snippet uses Bootstrap classes to make the output responsive.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.