query_vars['post_type']) && $wp->query_vars['post_type'] == 'amm-trasparente') {
if (have_posts()) {
add_filter('the_content', 'at_job_cpt_template_filter');
} else {
$wp_query->is_404 = true;
}
}
}
function at_job_cpt_template_filter($content)
{
global $wp_query;
$jobID = $wp_query->post->ID;
echo get_the_content();
echo '
Documenti Allegati:
';
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => get_the_ID(),
'orderby' => 'menu_order',
'order' => 'desc'
);
$attachments = get_posts($args);
if ($attachments) {
foreach ($attachments as $attachment) {
$class = "post-attachment mime-" . sanitize_title($attachment->post_mime_type);
echo '';
echo $attachment->post_title;
echo ' (';
echo at_format_bytes(filesize(get_attached_file($attachment->ID)));
echo ')';
}
}
}
?>