Using “get_template_part()” has very specific formatting requirements.
https://developer.wordpress.org/reference/functions/get_template_part/
To alter your example:
get_template_part( 'template-parts/content', 'page' );
would work, if your .php file was located at “template-parts/content-page.php”
Related Posts:
- Should we trust the post globals?
- How to use “Add link” pop up for a WordPress widget
- How to get all posts related to particular category name?
- Add tag to post api wordpress
- Confirmation box when submitting post for review
- how to limit edit_form_after_title hook to page and post edit only?
- Add a checkbox to post screen that adds a class to the title
- Add a new post status in the post progression
- How to add a quicklink to the Posts Admin Published|Scheduled|Trash menu
- How to show list of posts by author and category?
- How to cache a shortcode functions output?
- count number of posts (public , private , protected) by category name
- Getting the Next and Previous Posts Titles in the Sidebar?
- How to call function within a page/post, to dynamically generate content?
- Remove image caption from post excerpt
- How to control which category will be picked for the slug of a post?
- How to hide the Text Area in the Post Edit screen
- upload image in a meta box
- Post Size Limit
- Search posts by post author name
- Why is our post editor stuck at cols=40?
- How to force update all posts after import
- Change WordPress post-state in Admin Area
- how to limit and display tag?
- Insert custom div between posts
- How to have different content in the loop and single
- Make “Post published. View post” Open in a New Tab
- Custom Post Type & Author not associating, user post count is 0, api doesn’t return author in post objects
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- How to Display Post View Count
- Remove double space after a period
- How can I extract the URL of a link from a post?
- New posts defaulting to ‘0’ primary key
- add image map script to post
- Adding Multiple Values to a Post Meta Key
- How to create shortcode to show the 2 latest posts
- Multiple authors for single post without plugin
- Save list from a custom meta box?
- Same content shared between multiple posts?
- How to add in title a date but with other color, like in iMDb titles?
- Remove custom posts that match taxonomy value
- WordPress – Admin Manage Posts – Multiple Filters by Parent Category
- Author must complete profile info before they can publish a post?
- Advanced Custom Fields – Storing array value for further usage
- Warning: Creating default object from empty value in … /post.php
- Link button is not working while editing a post in Firefox [closed]
- Check if post exists
- Does an article (post) id ever change?
- Display page content AFTER a loop of posts
- How to get the date of a post in WordPress, so I could use it in a script?
- Unwanted Duplicate Posts Showing in Pagination Pages
- Post Type Label Name
- Disable author profile in post
- wp_query ‘s’ parameter does not work with custom post type
- Check is_single() outside loop
- Only display a certain number of posts, dependent on how many posts there are available in a query
- how to replace embedded “full” sized images within a post with the “large” ones
- Downgrade user from role that allows post creation
- How to store an extra (surrogate) ID when creating a post with wp_insert_post?
- Display a post by ID attribute with shortcode
- Change default Posts page
- Batch process: remove first image from post content
- Articles are text-only in any “Category” instead of HTML
- Retain select value in select box
- How to set up multiple taxonomies for groups of posts
- Facebook Share Thumbnail
- Update admin side post list count text
- How can I set a Post’s default visibility to private and pending review checked
- View the number of entries recorded per day
- How blog page in WordPress works : blog page retrieve first post ID
- Delete WordPress posts from URL list sql query
- Posts with multiple authors with different roles
- How to get the user meta data for a post?
- Blog Posts in Custom Menu
- Receive each week the number of posts published
- Transfer WordPress post to RoR site: is the REST Api the only and/or best solution?
- Alternate row and columns every X posts
- Custom WordPress Theme: Publish Date and Display Date for posts right beside each other
- How to change permalink on post click on post listing page
- Auto insert More tags in all posts
- How do I get blog posts to appear within CMS?
- Duplicate posts and change category
- How to change post status from frontend?
- Blog post per page setting conflicting with custom WP_Query?
- Removing noindex posts from wp_query
- Is there a PHP script to replace post date with updated modified date
- Show certain posts in a LIST format that members have been granted access to
- WordPress Rest API Create Post
- How to get next post ID?
- How to display content from the main blog on another from multisite network as it would be its own
- Multisite: Can’t Post or Create Categories
- Query values from a Post Object Repeater [closed]
- performance of post_exists
- Post visibility based on user role
- Add a custom meta box in the post options that loads some html code in the header
- Display an author’s posts on his own author page
- Static posts page with home.php
- Set static page/post from another blog on same network
- A/B testing of posts with unique URLs for each variant AND editing in custom fields
- how to bulk add one line in the first paragraph of all posts