query_vars['post_type']) && $wp->query_vars['post_type'] == 'spesa') {
if (have_posts()) {
add_filter('the_content', 'spesa_job_cpt_template_filter');
} else {
$wp_query->is_404 = true;
}
} else if (isset($wp->query_vars['post_type']) && $wp->query_vars['post_type'] == 'incarico') {
if (have_posts()) {
add_filter('the_content', 'incarico_job_cpt_template_filter');
} else {
$wp_query->is_404 = true;
}
}
function spesa_job_cpt_template_filter($content)
{
global $wp_query;
$jobID = $wp_query->post->ID;
echo get_post_meta(get_the_ID(), 'ammap_wysiwyg', true) . '
';
echo 'Importo: € ' . get_post_meta(get_the_ID(), 'ammap_importo', true) . '
';
echo 'Beneficiario: ' . get_post_meta(get_the_ID(), 'ammap_beneficiario', true) . '
';
echo 'Dati Fiscali: ' . get_post_meta(get_the_ID(), 'ammap_fiscale', true) . '
';
echo 'Norma: ' . get_post_meta(get_the_ID(), 'ammap_norma', true) . '
';
echo 'Modalità: ' . get_post_meta(get_the_ID(), 'ammap_assegnazione', true) . '
';
echo 'Responsabile: ' . get_post_meta(get_the_ID(), 'ammap_responsabile', true) . '
';
echo 'Determina: ' . get_post_meta(get_the_ID(), 'ammap_determina', true) . '
';
echo 'Data: ' . get_post_meta(get_the_ID(), 'ammap_data', true) . '
';
}
function incarico_job_cpt_template_filter($content)
{
global $wp_query;
$jobID = $wp_query->post->ID;
echo get_post_meta(get_the_ID(), 'ammap_wysiwyg', true) . '
';
echo 'Soggetto Percettore: € ' . get_post_meta(get_the_ID(), 'ammap_beneficiario', true) . '
';
echo 'Compenso Lordo Previsto: ' . get_post_meta(get_the_ID(), 'ammap_importo_previsto', true) . '
';
echo 'Compenso Lordo Erogato: ' . get_post_meta(get_the_ID(), 'ammap_importo', true) . '
';
echo 'Data inizio: ' . get_post_meta(get_the_ID(), 'ammap_data_inizio', true) . '
';
echo 'Data fine: ' . get_post_meta(get_the_ID(), 'ammap_data_fine', true) . '
';
}
?>