Create a child theme for your current theme. Read how to here.
After that create a file in your child theme named front-page.php
. This is the first file WordPress will look for when you visit the home page of your site.
To understand why, read here.
In that file use:
<?php
get_header();
$all_pages = get_pages();
global $post;
echo '<div class="pages-container">';
foreach ( $all_pages as $post ) {
setup_postdata($post);
// improve the content, this is an example
echo '<h2>' . the_title() . '</h2>';
echo '<div class="page">' . the_content() . '</div>';
}
echo '</div>';
wp_reset_postdata();
get_footer();
The docs for function I’ve used are here:
Related Posts:
- How to display summary content from a Page (Not a Post) on another page
- Page template query with WP_Query
- How to display page content in a page template?
- Does WordPress generate an automatic page for post formats?
- Pagination causes error 404 when used with front-page.php
- Paginated pages are showing correct content but pagination links are not
- Single page theme that uses pages for the content
- Trying to list out child pages with WP_Query
- Order by menu structure
- How to display 3 different loops in 3 columns on homepage
- Targeting specific pages in the loop
- What are the differences between “Latest Posts” and “Static Page”?
- WP_Query not retrieving by random order under parent
- Set if condition with wp_nav_menu
- Set order of returned items in the WP_Query() class/function
- Search pages that are a child of the current page
- Serve specific “template” page at any URL that ends in its slug
- Display custom tags on pages that have a specific page parent
- Is there a reason why Pages are not publicly_queryable?
- Why post__not_in is ignored?
- Reusing content from front page on sub page
- Exclude parent with child pages from WP_Query
- Set front_page programatically after user login via query, while leaving site option alone
- Create a loop on my pages with new “WP_Query”
- All blog data on a page using custom query gives 404 for page 2 and onward
- When listing child pages run out of memory
- WPQuery calling specific posts problem
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- Display specific page (that is child) content on parent page
- Get query results with a page title
- How to get current page nearest parent id?
- How to get main menu only with wp_nav_menu
- Unable to paginate a custom page query
- Determine if ID is page or post and query the ID
- How to query for a page, get data, then query for child pages of that page
- Get list of all Grandchild Pages
- Custom query does not find pages
- How to get pages of parent (non-recursive)?
- WP Query and multiple pages
- How to use custom page for all posts with custom url, call another directory?
- display the children of the post using the current page as the main parent
- pages shortcode filtering by category
- Letting wordpress decide what template and page to use based on condition
- Paginated Post List on Front Page
- How to create page that lists tags by initial letter?
- Get a page ancestor from a most viewed list
- How can I use a specific wordpress page template if certain words are used in page title [closed]
- Category Archive not working for pages
- Retrieving category pages from subcategory returns empty sets
- Issue in If else condition [closed]
- Show parent’s child and also child’s, child on a page?
- get contents and permalink from a specified page
- Hierarchical List Pages as a table
- Get next post when using pagination with WP_Query?
- WordPress pagination returns the same posts
- How to write short code with if else to get page_id?
- WP_Query orderby date not working
- Best way to detect if you are in a SINGLE POST page
- Better way to get tag stats?
- Sort posts by custom taxonomy name
- Filtering posts by custom field value not working
- wpdb get results doesn’t work with variable
- Query Ignoring ‘exclude’ Parameter?
- Custom pagination with WP_Query generating 404 error
- Apply CSS class to every second database record [closed]
- Loop on front-page.php
- merge two query arguments into one WP_Query call
- Adding a parameter to the default query
- Using WP_Query in “parse_query” or “pre_get_post” in Posts2Posts
- How do I change the order (ASC and DESC) in the following retrieval method using WP_Query?
- While creating Block Themes in WordPress, how can I query custom posts for an Archive view?
- Custom post type archive pagination query issue
- WP Group posts by year(desc) > month(desc) > date(asc)
- Array as ‘key’ in WP_Query
- Check the Specific Meta Key IF its Meta Value is Empty then… (WP Post Meta Query)
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- Apply filters to main query instead of creating new one?
- WP_Query returns different results from get_posts() [closed]
- How to pass query string vars between admin pages?
- Query posts by Post title
- mysql query order by
- Why do I have to use pre_get_posts with custom WP_Query to reset posts_per_page?
- Multiple Query_Posts
- WP_Query: attachment image in “full” size?
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- Make a products only viewable to a specific user ID in meta_query pre_get_posts
- Get categories within specific term
- How can I query a radius of coordinates?
- custom excerpt is not being shown
- meta_query only check if both value are set
- post_type not working when tag__in is present?
- Seach and categories not working when ignoring sticky posts in main loop
- WP_Query shows all posts on single post pages
- Display Count of posts
- Dynamically name array in WordPress loop – add/get values
- Creating Custom Query
- Help in query for list links
- WP_Query issues with argument posts_per_page
- Search (Custom Form, Custom Search Result)
- Elementor custom query