The function get_page()
has been deprecated, don’t use it anymore, use get_post()
instead. get_page_by_title()
returns an object by default, you can change this by altering the $output
parameter, which you can use like you did. Although get_post()
can take an object as $id
parameter I personally prefer inputing the ID, but that actually shouldn’t matter.
$page = get_page_by_title( 'About' );
$page_data = get_post( $page->ID );
echo $page_data->post_content;
What you’re describing – at least based on the code in your question – should have nothing to do with templates or the get_template_part()
function, because the post_content
you’re getting is independent from that. The case would of course be different from that, if what your are missing from those pages you talk about isn’t actually part of the post_content
, but your question isn’t indicating that.
Related Posts:
- Is there any way to use get_template_part() with folders?
- Is it possible to override the result of get_template_part()?
- Get template part vs locate template function
- Templates & CSS – Proper Programming Practice?
- TwentyTen: Overloading template.php files vs. get_template_part
- Passing variables to template parts
- How to move style from template file to section?
- Unable to include a template
- Where is the template for the ‘standard’ format of a post in the theme twentythirteen?
- Valid HTML in Template Part
- Remove portion of header code from home page only
- Use a separate template for the home page only
- How to create new template page and template-parts in wordpress theme [closed]
- Organize template parts and page templates in folders in regards of template hierarchy
- How to get all template files used for rendering a single post/page?
- get_template_part for template in subdirectory not working
- Display a custom 404 page without a redirect
- How can I show contents of a template part inside of another page?
- When to use content-pagename.php?
- Is it possible to call a template file inside wysiwyg editor? And how?
- Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?
- Is there a way to list all used/unused WP templates?
- Print WordPress template filename(s) for debugging
- How to add custom content template part for a custom post type on main query using a plugin
- Change the name of the ‘Default Template’
- Echoing Elementor page content in template, but it doesn’t get styles and some widgets are missing
- How can I modify the default reset (lost) password email text?
- Template files missing after moving site
- Grid layout “last” class to every third item
- How do you modify Page Template?
- Using “setup_postdata” with “get_template_part” does not work
- How can I get the content of the home page?
- Why aren’t my posts showing?
- How to display error on specific template?
- What is content.php file that is needed for Jetpack infinite scroll plugin?
- Auto-Generate Longtail-SEO Pages/URLs
- bloginfo(‘template_directory’) img src
- Should template files be copied to the child theme for editing?
- Best Constant to use to check if WordPress is running
- WordPress automatically created files like .theme-name / .plugin-name.php [closed]
- style sheet header on Page Templates
- How to support custom templates on a custom post type?
- How to use $wpdb (from the template) to update the DB, without being an admin
- Page attributes missing
- Remove Items from Template Homepage
- Bizarre issue with custom RSS template
- Using shortcode in template file
- Display current category and child
- Return get_header and get_footer string instead of echo it
- Different templates for same content, landing page from different URLs (generic, simple)
- Use one template only for custom post type archives?
- Is there a more efficient way to loop through pages?
- Is it possible to register a new template file?
- What template is used for viewing Media Library Files?
- Create a blank test.php
- How do I remove the word “Blog” from a WordPress Homepage?
- How to use template inside plugin shortcode with variables for big HTML code
- AMP version of front page without plugin
- Give wp link pages it’s own template
- How to add description over forum list on bbpress root page
- two active templates for one post
- Where is the code for “Front Page Template”?
- Help Understanding Template Hierarchy
- what is template-name.php
- templates with page teasers Or Featured Items
- If Child or Grandchild of Page
- Page template not registering on theme
- Is it possible to create custom links inside a template?
- How do I custom a page that doesn’t exist in the page list?
- Uncaught Error: Call to undefined function twentytwenty_the_post_meta()
- Timber + MtHaml, or any other HAML-like HTML shorthand
- small problem in the article ()
- Unable to access wordpress page
- How to configure my blog page
- BuddyPress : how can I call the template WordPress would have chosen (template hierarchy)?
- How can I make custom page templates work on child theme?
- Archive only for /year/month, not terms
- Why default template does not show?
- Why does the blog page not take the page template selected?
- Custom Taxonomy Theme file not routing correctly
- Why would adding a template file to a child theme cause an error in template-loader.php?
- How can I make is_page_template() workable in child theme?
- How can I add some blocks to template without changing template file?
- Creating a popup
- WordPress not picking up custom templates in sub directory
- Category template not displaying all post formats
- Retrieving post ID from current page
- Mysterious template change after database import/export
- Is there a way to share a template/markup with the JSON API so that it doesn’t need to be declared both in PHP and in JS?
- WordPress sites translate dynamically generated Homepages
- changes to templates not showing on server
- Why is this page using the homepage template and not the one it should?
- Single template will not show sidebar/bottom-nav and footer
- Problem with permalink structure for WordPress custom post_type archive template
- Make default template two columns?
- Read more button not working
- pass dynamic value to page to pull in categorised post cards
- How to limit block activity (insertion/deletion) to inside of a Block Template on the Admin Screen?
- How to change post template
- Unload templates; disable parent Template Parts using only “theme.json”