Per includere un Post di WordPress in una pagina o in un altro post, si può utilizzare questa funzione.
Deve essere posizionata nel file functions.php del Tema che stiamo utilizzando:
<?php function diww_include_post($atts) {
$thepostid = intval($atts[id]);
$output = '';
query_posts("p=$thepostid");
if (have_posts()) : while (have_posts()) : the_post();
$output .= get_the_content($post->ID);
endwhile; else:
// failed, output nothing
endif;
wp_reset_query();
return $output;
}
add_shortcode("include_post", "diww_include_post");
A questo punto sarà sufficiente utilizzare questo shortcode, nel punto in cui vogliamo inserire il post:
[include_post id=”101″]
Fonti : WordPress, Assistenza WordPress, Sviluppatore WordPress, Web-Agency WordPress, Consulente WordPressSupporto tecnico, Assistenza WordPress, Assistenza e-commerce WordPress, Assistenza Sito WordPress, Assistenza WordPressFirenze, Assistenza WordPress Prato, includere post di wordpress, includere post di wordpress in una pagina, includere post di wordpress in un altro post, inserire post in una pagina, inserire Post in un altro post, include post WordPress, Post WordPress includere