Wrap the_content() function like below
$args = array(
'post_type' => 'your-custom-post-type',
);
$query = new WP_Query( $args );
while( $query->have_posts() ):
$query->the_post();
the_content();
endwhile; wp_reset_postdata();
one thing to note here though, you must know where to end the loop ( i.e., endwhile; )
as you’ve other markup in the page template ( I assumed that above code belongs to post-template.php )
Another thing I noticed, if the post-template.php is template for about us page, then you can get content by
selecting respective page template for about us page in wordpress backend.
then,
while( have_posts() ):
the_post();
the_content();
endwhile; wp_reset_postdata();
Related Posts:
- Multiple is_page() in page.php
- class=”parent” for wp_list_pages?
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- Listing all sub-pages?
- syntax issue on php 7.4
- How do I publish only one page to production after making changes on staging?
- Can’t load WP function into external function
- Way to querry data (tags) from a wordpress database?
- Populate editor with some content of a page with a page template
- Create Page To Count Comments For Each Post In WordPress Site
- Inject class in body when particular page template is used
- Use .php file as page instead of wordpress page & template file?
- Use WordPress function in php file
- How to use theme function in post/page?
- Need php code’s output to display underneath a Divi Module
- PHP Output also in Child theme, but different
- How to Display a List of Child Pages For a Parent Page in WordPress
- A function to get the content of a page
- Getting page / post URL on publish and / or update
- How to return a Boolean for a page that is a subpage thru its name?
- Disable Attachment Pages Completely
- How to get the original price of the product in woocommerce?
- How to redirect users to custom lostpassword page?
- How to use WordPress (PHP) functions in AngularJS partials files?
- Can I write ‘RewriteCond’ using ‘functions.php’?
- How to add 2 posts under another post? Formatting should be intact
- Overriding a theme redux file in child theme
- Validate a users email address when using gmail to register
- Get widget settings function?
- enqueue multiple Google fonts with multiple weights and styles (italic)
- Add a Different CSS Class Into The Body Tag of Different WP Pages
- What is the fastest way to load PHP functions that are only used in one theme template?
- Adding tawk.to code just before body tag on functions.php file
- Custom Template 404 for specific custom post type
- allow subscribers to see private posts without plug in
- Only Show Link If div Exists
- How to style options page in dashboard?
- Change the WP Video Shortcode Output
- Validate functions before inserting then into functions.php
- How to retrieve current wordpress profile page URL?
- Why ajax doesn’t work on certain wordpress hooks?
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Exclude category
- Security for data obtained from the database
- What exactly do this function declared into functions.php file of a WP theme?
- Display Data in Table from External Database in WP using Shortcodes
- How to check if a Customizer setting is set?
- Custom Pagination is Broken
- Sidebar not appearing in footer, but it appears everywhere else!
- Co-Authors Plus: How do I get all authors with a query?
- Why i can’t get custom fields value or post ID via Ajax?
- List post by title length
- How to reference PHP in Javascript
- Fallback image URL if no featured image exists via a shortcode function
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Deactivate a plugin on wp version
- making php value numeric
- the_post_thumbnail issues
- Some problems calling a function into sprintf() inside functions.php template file [closed]
- WP insert post Redirect after function has executed
- How to assign page id with array in page_scheduled_event
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- Cannot find the php_ini configuration file to find my error log to see why my code is not working
- How to Send Pingbacks for all Posts in WordPress?
- HTML comment cause issue in functions.php script root
- Programmatically add a product to the cart and set price to zero when buying from certain category
- I want to show cart items number if any or nothing, simple CART text
- Hide a specific category title from displaying on site
- Return newly created category by code
- WordPress Ajax filter: Create two loops for different output styles?
- Handling form actions in WordPress
- Hook into all password resets in WordPress and get password before hashing?
- How to call a function from functions.php with ajax?
- Set user status to absent on WordPress
- Shortcode’s output to use as other shortcode’s parameter
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Displaying POST content with HTML tags and all
- PHP script to redirect traffic based on website accessed
- How to remove title tag with this filter
- Dropdown menu on custom menu
- Showing wordpress latest post thumbnails in slider with auto increment
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- My function echos only “array”
- Notify admin (by email) if post added with specific tag
- Retrieving specific images from Media Library
- Can’t put a hyperlink on Featured Post’s Image
- Limit Taxonomy Parents
- WordPress HTML Helper
- List sibling pages widget, exclude current page
- How to add feature image url in my template file and content as well?
- How to add button to top of theme customizer?
- Send foreach $_post method to contact form 7 [closed]
- Options.php loop won’t show!
- Contact form with dynamic dropdown and filter
- Critical Error customiser
- Alternative to php echo within code
- Add multiple HTML attributes to an Elementor button
- /page/2/ redirect to 404
- How to pass value to add_filter wpcf7_form_tag from another function?