wordpress get particular page content programmatically
<?php
$id=47;
$post = get_post($id);
$content = apply_filters('the_content', $post->post_content);
echo $content;
?>
wordpress get particular page content programmatically
<?php
$id=47;
$post = get_post($id);
$content = apply_filters('the_content', $post->post_content);
echo $content;
?>
wordpress get id from page title
//You can use OBJECT or null
/*
* RETURNS: the post array
* post_name: is the name of the post you are looking for
* OBJECT: accepts results of WP_posts or get_posts (i.e. $posts)
* if you don't have and OBJECT just use null instead
* post_type: the name of your post type (i.e. 'page' or 'post'
* additional information https://developer.wordpress.org/reference/functions/get_page_by_title/
*
* ALSO get_page_by_path ('slug_name', OBJECT, 'post_type')
*/
$post = get_page_by_title( 'post_name' , OBJECT, 'post_type' );
echo $post->ID;
wordpress get id of current page
Finding and adding id to body class
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us