alieneila,
Thanks for your reply.
I am using WordPress 3.4.2., and I have searched all PHP files for the Get_post function, including wp-includes/post.php. It isn’t in my version.
Setting that to one side, perhaps if I gave more details, you could suggest a solution.
I am using a theme called “Thesis”, which provides numerous “hooks” in which one may insert custom code. One of these hooks is labeled “these_hook_before_sidebar_1”. It contains the following code:]
<?php
if (is_single()) {
?>
<div class="columntext" id="c4">
<ul class="columnlinks">
<li><a>')">Printer-friendly page</a></li>
</div>
<?php } ?>
[please mark all posted codes using the ‘code’ button – https://pastebin.com/ – the above section is already corrupted by the forum parser]
(Elesewhere, there is logic that determines when this particular code runs. I use a plugin called “widget logic” for that.)
This runs fine. A window appears, and it runs a file named “2printer.php, which is in a separate “include” directory (not in the WP directories.)
Here is the contents of that PHP file. I have hard-coded an ID number, trying to get it to load the contents.
But all I get is an error saying that the function “Get_post” cannot be found. I was hoping that if I “included” the PHP file containing that function, it would “find” the function and run it. Here’s my code:
**********************************************************************
<link rel="stylesheet" href="<?php echo $_SERVER['DOCUMENT_ROOT']?>/wordpress/wp-content/themes/thesis_18/custom/custom.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php
$my_id = 1689;
$post_id_1689 = get_post($my_id);
$contents = $post_id_1689->post_content;
echo $contents;exit;
</div>";
?>
</body>
</html>
*********************************************************************
As I say, when I run this, I get a window with an error message.
All I want is a window with the contents of whatever post is being displayed in the “parent” window.
I’m open to suggestions.
Thanks ~ jan