I have got this working code using wordpress and advanced custom fields:
$include = get_pages('include=1575');
$title = apply_filters('the_title',$include[0]->post_title);
$content = apply_filters('the_content',$include[0]->post_content);
I want to create a var replacing the post_id in include=1575. I get this var using:
$site_id = the_field('id_grundgedanke'); // output exp: 1575
How I can I combine these? I have tried the following:
$site_id = the_field('id_grundgedanke');
$include = get_pages('include=' . $site_id);
$title = apply_filters('the_title',$include[0]->post_title);
$content = apply_filters('the_content',$include[0]->post_content);
Which does not work.