MahdiY just explain that you can use PHP in your template like that
<?php
/*
Template Name: news
*/
get_header();
?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
echo "This is PHP";
?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
Related Posts:
- Custom single page based on which custom page template is selected
- How to disable page delete
- get_pages() not ordering as it should
- Using single.php from plugin folder instead of default template folder
- Editing the Number at the end of Page URLs / Editing Page Slugs
- Pagination Help on Crazy Custom Authors Page
- Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123
- Hide page title in WordPress 3.0
- Selecting An image from the Media LIbrary on the frontend
- Custom protected password page with ACF
- Page load requires a trailing “/” [closed]
- Virtual Pages plugins
- Programmatically add a custom page/path/url/route to WordPress
- What is the most idiomatic way to let clients edit phrases in HTML?
- How to merge all my pages into one, while keeping a menu bar?
- How to change URL Custom Page?
- redirect product-category to a custom page
- custom headers for static home page and posts page
- in_category() works in single.php but not in page.php?
- Show posts on a page based on a category and tag(s)
- Split Conference WordPress Page in different years
- Add google org chart to wordpress page
- how to get the categories for a single product in a hierarchical way
- How to get custom page template being edited in gutenberg editor
- Control Content On Non-Blog Pages
- custom meta box for page default template
- Best practice – pages – ACF or inline coding
- How to hook up search results page to a back-end page?
- How to structure model showcase
- How to customize
- Adding comments to my custom theme
- Add a searchbox to the body of a page
- Create page as a file in my theme?
- Featured Image If Else Condition
- Insert menu with a custom walker into page / post body using shortcode?
- How to create “custom page types” with different custom fields in them?
- How to create custom search page
- How to display page ids as page slug names?
- How to create custom layouts and static pages in themes for clients
- How to make the Pages in WordPress Customized?
- Creating custom page template
- Change Site Logo or Menu Logo Per Page
- change top banner content on specific page
- How to add page content into another page
- How to move meta information in TwentyTwelve’s single post template?
- Display a specified content on a Page and all its child pages
- Use a custom page with dynamic content as a user profile page
- I want to embed mystream video in my wordpress site
- Swap home page based on user role, Elementor layout breaking
- Taxonomy template is not reading
- New Page/Post Screen Opens an Existing Post
- Static Page, need Last and Next links at the bottom
- How can I create a Custom Page? (not a page template!!)
- wordpress custom posts page not showing
- How to serve an already coded html page in a WP page, to assign a simpler url
- Custom Single Template
- Create single{custom}.php with data in table out of wp_posts
- Admin menu disable new/delete page
- Show different pages on site depending on user choice
- WordPress post submit page
- Redirect Every Instance of The Author Template Pages to Custom Author Pages
- Allow arbitrary text after page URL
- Best way to create a page outside of the pages list
- Want home page to click through to two different page types
- How to duplicate “Pages” section in the control panel?
- Page template with custom html fields inside a content
- Custom Style per Post, How to Display Custom-Styled Single post on Homepage?
- Different post into a single page
- Pass query param to custom page
- Is there a way to have information on one page automatically feed into another? [closed]
- how to add a page
- How to apply styles to the custom page template
- How can I make a search term redirect to a page
- Custom CSS working on home page but not on NEW created PAGE
- How to display product variations on same row
- Create a page for each database table entries
- How to use standalone Gutenberg (block editor) instance on any my own admin page in WordPress
- Custom jQuery code in Elementor page is not working on Mac os. On Windows browser work fine
- Block Theme: How to use a different template on front page vs paginated pages?
- How to: Easily Move a WordPress Install from Development to Production?
- Is there a flowchart for WordPress loading sequence?
- Essential technical features for high-end WordPress web hosting? [closed]
- How to remove admin menu pages inserted by plugins?
- How to put logs in WordPress
- How to get the Date Format and Time Format settings for use in my template?
- Where are Additional CSS files stored
- Best Practices for Regression Testing WordPress Websites?
- Remove wrapping div and ul from output of wp_nav_menu
- What Is The Use Of map_meta_cap Filter?
- get post author id outside loop
- Custom Walker: how to get ID in function start_lvl
- Creative uses of WordPress [closed]
- How to *remove* a parent theme page template from a child theme?
- How do I make my child theme re-apply the settings that were customised when its parent was active?
- Multiple Inputs in a Customizer Control
- New WP_Customize API – how does it work under the hood?
- Embedding a SOAP Client into a WordPress Plugin?
- Is there anything that Joomla or Drupal can do that can’t be done in WordPress? [closed]
- Update widget form after drag-and-drop (WP save bug)
- Data sanitization: Best Practices with code examples