So I'm a little stuck. I'm a total newbie in WordPress, and yet, I need to get something done. Here's the problem.
I have a section with contacts on the site, that repeats itself several times on several pages. I made that page a template and added custom fields to it. So now, I need to have it displayed on several other pages. However, nothing I do seems to work. I realize that I lack some fundamental understanding of WordPress mechanics, I'm still learning it, and yet, I hope you can help me.
When I try to display it by page id,like this:
$post_id = 605;
$newpost = pll_get_post($post_id);
$queried_post = get_post($newpost);
$content = $queried_post->post_content;
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
It gives me a blank page. If I add some text to the page in the editor, it outputs only that text. It does not output the HTML structure of my template. So the problem is getting the template page + custom fields.
I've wasted way too much time on this.