Just link to it. That’s all there is to it. 🙂
The pages (and posts, and other content) that’s created by your WordPress site is just considered to be another “page” on your website. All you need is the link, and you can link to it form any static HTML page anywhere.
I know that, i want it to be a part of the website, like a “php include”
Moderator
t-p
(@t-p)
That’s a bit more difficult. The big question is what do you want to include? The content, some WordPress functions, something else?
I found this code but it would post any post, i would like to post a specific post. here is the code
<?php
global $post;
$args = array( ‘posts_per_page’ => 1 );
$lastposts = get_posts( $args );
foreach ( $lastposts as $post ) :
setup_postdata( $post ); ?>
<?php the_content(); ?>
<?php endforeach;
wp_reset_postdata(); ?>
just want the content of the page or for that matter a post that i can specify
That won’t work on a stand-along HTML or PHP page. The reasonf or that is that your site won’t have the various WordPress functions (like get_posts()) available.
The “proper” way to do this is to hook into the WordPress REST API, and query it for the post ID that you want.
https://developer.wordpress.org/rest-api/reference/posts/
https://css-tricks.com/using-the-wp-api-to-fetch-posts/
https://wordpress.stackexchange.com/questions/222547/wp-rest-api-retrieve-content-from-page