Hi,
I am using ajax to show page content like this:
$pageUrl = $_REQUEST['URL'];
$postid = url_to_postid( $pageUrl );
$post = get_post($postid);
$content = apply_filters('the_content', $post->post_content);
echo $content;
But how could I show titles and acf fields?
I tried stuff like this (without success, only title is echoed)
<?php
$pageUrl = $_REQUEST['URL'];
$postid = url_to_postid( $pageUrl );
$post = get_post($postid);
?>
<h1><?php echo get_the_title($post); ?></h1>
<?php echo get_the_content($post); ?>
<?php echo get_the_field('testfield', $post); ?>
Anyone?