Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Get page title, excerpt or content by id

<?php 
$var_name = get_post('1'); // here 1 is id of the page.

echo $page_title = $var_name->post_title;

echo $page_excerpt = $var_name->post_excerpt;

echo $page_content = $var_name->post_content;
?>
Comment

Get page title, excerpt or content by Name of the Page

<?php 
$page_name = get_page_by_title( 'About' ); // here About is page name.


echo $page_title = $page_name->post_title;

echo $page_excerpt = $page_name->post_excerpt;

echo $page_content = $page_name->post_content;
?>
Comment

PREVIOUS NEXT
Code Example
Php :: Remove WordPress Login error hints 
Php :: Insert Data using modal 
Php :: Laravel/Php Carmel Casing / Title Casing 
Php :: provenienza geografica di un utente php webmaster 
Php :: php base64 encode utf8 
Php :: form alter drupal 9 language code 
Php :: Yii2 Dynamic Relational, Eager loading 
Php :: wordpress show notice only on plugin page 
Php :: Laravel - How to create custom configuration variables and access 
Php :: laravel where has relation 
Php :: laravel {{variable}} not being rendered 
Php :: child data retrive without timestamp laravel 
Php :: response in xml laravel 
Php :: stop php execution with javascript 
Php :: exclude row from clooection laravel 
Php :: Laravel 7 view @php 
Php :: session 
Php :: what does ? do in php 
Php :: print_r php 8 
Php :: doctrine findby criteria 
Php :: define value in php 
Php :: php check if passwords match 
Php :: views_pre_view 
Java :: No Java files found that extend CordovaActivity. 
Java :: how to play sounds on java 
Java :: javafx dependency 
Java :: spring boot security maven 
Java :: swing disable button 
Java :: toast java example 
Java :: convert a string to int in java 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =