I have not tested this but based on your question, this should get you on track:
<?php
$id = 4; // The Page or post ID
$page_data = get_post( $id );
$title = $page_data->post_title;
$content = $page_data->post_content;
$excerpt = substr($content, 0, 155);
$featured_image = wp_get_attachment_url( get_post_thumbnail_id($id, 'thumbnail') );
?>
<div class="post">
<h1><?php echo $title; ?></h1>
<div class="featured"><img src="https://wordpress.stackexchange.com/questions/147844/<?php echo $featured_image; ?>" /></div>
<p class="excerpt"><strong><?php echo $excerpt; ?></strong></p>
<p class="content"><?php echo $content; ?></p>
</div>
Related Posts:
- Hook for URL Request
- How can I add a default description to uploaded files?
- How to get WordPress’ hooks/actions run sequence?
- Is there a hook that runs after a user logs in?
- WP Cron Doesn’t Execute When Time Elapses
- Why do some hooks not work inside class context?
- Action hook for custom tax edit
- Is there a limit to hook priority?
- Auto-retrieve YouTube Image for Thumbnail?
- Hook into WordPress update?
- Do WordPress Core Filenames Work as Hooks?
- How to check if which hook triggered the call to a function?
- How do I flush the rules after saving settings using the Settings API?
- Run javascript code after wp_login hook?
- Is it possible to save/modify a post without calling the “save_post” action hook?
- Redirect logged in users if they are on a specific page
- Generating robots.txt dynamically
- Hooks are not executing
- Rest API Hook When Post Is Requested
- Best possible way to get all options
- wordpress custom modules/widget areas on the page? can i make my own?
- How to add hook to the_title() and get_the_title()
- Add custom URLs to WordPress’s XML sitemap
- Hooking after get_header()
- How to get post ID in post_updated action hook?
- How can I set status=’publish’ for all featured images?
- How to change title attribute returned by comments_popup_link()?
- How to use do_action_ref_array?
- Problem using role_has_cap hook
- How to find hooks as per Just-In-Time approach?
- WordPress action and filter hooks runs asynchronously?
- Prevent attachment from being deleted
- Update post meta using pending_to_publish hook
- Get log of function/method calls made by do_action() on WordPress initialization
- Is it possible to change image urls by hooks?
- User update hook
- register_activation_hook not updating
- Redirect customer to login if not logged in when proceeding to checkout
- PHP header() gives headers already sent
- Send along login credentials with comment content
- How to replace a function using a child theme?
- WP_query hooks before execute a search query
- How to pass argument to wp_footer hook with data from a template
- Redirecting from login
- How to use a 3rd party library to send emails?
- WordPress wp_loaded action hook
- I would like to send a notification email (Asana) whenever something is published (posts, pages, custom post types) [duplicate]
- Check if `do_action()` in WordPress returns any result
- Woocommerce table is missing a heading–can I add it by use of a hook?
- Use a variable created in get_header to calculate stuff in wp_footer
- register_deactivation_hook argument -> pass arguments in the selected function
- Alternative to new_to_publish Hook for Custom Statuses
- How to use a WooCommerce action hook?
- add_action hook for publish_post not working
- Force file download in WordPress
- How to use pre_get_posts
- hooks for automatic approve user registration according to data in custom fields
- How to render an element, that was saved as a template, using a hook?
- How to use embed_content hook?
- Notify admin when Custom post meta data gets updated or deletet
- WP Cron not executing after timespan
- Action hook with wrapper html
- call php file from form and use wp functions
- wp_insert_post hook for a wordpress plugin
- WordPress add_action the_post hook
- Post via wp-admin and via iOS app, same hooks and triggers involved?
- add_action hook for links.php page
- Hooking after blog info update
- Hook to add_action(‘updated_option_my_option’, [$this, ‘save_data’], 10, 3]);
- Session management issues with WordPRess 404 Error page
- Template_redirect works, but headers aren’t sent when checking via cURL
- template_redirect hooks redirect wrong URL
- Registered custom dynamic tag not appearing
- Add a Call to Action Button to WordPress Post Thumbnail
- How to hook add_action() into after category description with id?
- What hook can you use to get the full response?
- Easy Digital Downloads – How to use hooks correctly?
- Updating a related post’s “post_modified” value
- adding wordpress yoast SEO canonical url from “transition_post_status” hook
- Cookie cant be read even cookie is present
- How to create callback function which returns all posts with specific data?
- How to trigger click events using hooks
- remove_action() hook not working
- Why the post ID is 0 in a hook within wp_insert_post_data?
- Function Hooked on Init Running Multiple Times
- How to work with hooks and Posts to posts plugin?
- Send email to post author 1 day before his project ends
- template_redirect and title
- When is get_currentuserinfo() needed?
- disable publish button until condition is not met
- How do I remove an action hook by s2member
- prepopulate form from a hook within wordpress function.php file
- Change Title Type
- How do I change TinyMCE button “i” to create a i tag rather than em? [duplicate]
- How can I modify the code generated for a PDF by the Add Media button in Classic Editor?
- Do New_to_publish hooks work for custom post types
- Creating my own “recent blog posts” static Gutenberg block, can’t use react hooks in the frontend
- How do I set a custom post type Category after import using wp_set_post_terms
- Hooks to trigger a callback when adding, removing, rearranging or updating a widget in the widget area
- Why does before_delete_post run when opening a post in the backend?