While inside a query loop, this function will output the current posts title:
the_title();
This function will output the content:
the_content();
What I suspect has happened however is that you are instead calling get_template_part( 'content', 'page' );
and expecting it to output the content for the page, when what it’s actually doing is checking if there’s a content-page.php
, and including it if it’s present, if not it checks for content.php
and includes that, and because neither exist, it’s doing nothing, and so you get no content.
For more details on what get_template_part
actually does, look here:
http://codex.wordpress.org/Function_Reference/get_template_part
EDIT*
Working snippet:
<?php while ( have_posts() ) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php endwhile; // end of the loop. ?>
Related Posts:
- Guidance with The Loop for CMS
- WordPress shows registration link for non logged users
- WordPress vs. Custom PHP [closed]
- Lost in trying to create user database system
- Fatal error: Cannot redeclare comment_theme()
- In adding CMS functionality to static website, is complete conversion the only way?
- In WordPress, how do you make several different editors for a single page?
- Make separate text boxes for separate WordPress Custom Fields
- How to add WordPress Featured image in tag ..?
- Changable favicon
- Migrate php folder to WordPress
- Combining fancybox with multiple thumbnail plugin
- Arrange Category post manually when displayed
- Trying to fix multiple category drop down
- the_date() not working
- How to return number of found rows from SELECT query
- WP-API v2 Custom Endpoint Response Formatting
- Multiple is_page() in page.php
- Get author full name
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Extract the first oembed url inserted on the content of a post
- WP API V2 returning Invalid User ID
- Limit the_excerpt with max of x characters
- How can update custom meta for all posts
- Sanitize get_query_var() url parameters
- Passing the page ID to a login php script
- PHP/MySQL issues when running WP on EC2 cloud [closed]
- wrong php date()?
- How to safely remove the footer (twentytwenty)
- It is a good idea to store values from the global $post if they are used multiple times?
- How do I fetch all comments per post via WP REST API?
- When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?
- esc_url returns incorrect URL
- Using More Tag in Combination with the_excerpt
- combine Code 1 with Code 2
- Custom Form Processing Issue
- Custom theme: Alternatives to long list of ‘include’ in functions.php
- WordPress Theme Options Values
- How to Sort posts by Vote Count?
- How to control WordPress image metadata (using Imagick)?
- Modifier l’affichage du prix sur la fiche produit
- How can I get a single php file that is the equivalent of an existing WordPress page?
- Ajax date_query not working past the first iteration
- get_terms pagination
- PHP file won’t work in wordpress folder, but works in another virtual host
- How to use thumbnail size of image if I’m only using src to get image
- Use URL Rewrite as well as $_GET parameters in URL?
- I want to add custom add to cart link [closed]
- Output custom field value to post string
- showing 2 prices wholesale and normal
- wordpress wp_enqueue_script() not working
- What is the proper way to include a PHP framework into my theme?
- Update post title from external file?
- WordPress plug-in for dynamic download link?
- Help with page nav?
- How can I add a new row in a separate database when someone registers via WordPress?
- Design with Elementor and code the rest?
- How to use mysql LIKE with wpdb?
- Get all posts as an array ID => Name
- wordpress site – using custom database and PHP
- cURL error 6 on news area, and also won’t auto update
- Change homepage content if user is logged in – BuddyPress
- Custom upload folder
- How to manually trigger a redirect to another page without changing the url address?
- Displaying Event within two given time frames
- How to get my [shortcode] rendered on the home page, other pages are fine
- Display movies that apear this day next
- Wp favorites posts by specific category? [closed]
- How to edit background color of only one sidebar?
- How to add JS script in specific pages in WordPress?
- Fatal error login WordPress [duplicate]
- Pagination contents not changing in Front page WordPress
- How to select post ID for given parent name with nested prepared queries?
- How do I programmatically add ‘reviews_allowed’ to WooCommerce product?
- Why is values of a global variable returning blank when inserted into database
- How to return html as a string from php for WordPress
- Show Gutenberg facebook embed with a custom theme
- Add code to the header of posts by particular author
- Running a PHP SQL script on a wordpress page
- Taxonomy Child Term, Counter is staying on 0
- How to apply ‘add two more posts’ to media content?
- How to disable sub menu items from being created?
- LinkedIn Share Post Button
- load a wordpress page into another wordpress page using iframe
- How do I modify the Previous and Next Page posts on blog pages to include “previous” and “next” before the links?
- Explode Content within specific HTML element
- Using get_theme_mod with checkbox to display content
- Add specific content after specific text in every post
- On selecting shortcode generate selected shortcode table inside page editor worrdpress
- Using existing widget code! [closed]
- Pagenav Not appearing on custom Template
- Automatically load WordPress page on server every XX hours
- Open WordPress Page from selected option dropdown
- WordPress different custom tag being displayed in on tag list
- PayPal button not showing and cannot retrieve order error in PayPal
- Why do I get a 404 error on my custom post type archive pagination?
- Need Help With Making Full-Width Template for Blog Posts (common methods aren’t working)
- change div text and link for logged in users
- Font Awesome Icons as squares [closed]
- index.php changed on its own