This article presents some terms that are commonly used when working with WordPress.
A “page” is a webpage. So this could be your site’s homepage or an inner page.
Notice the capitalization in Page.
A “Page” is a static Page. You can see the list of all Pages in your site by clicking on Pages in the WordPress admin.
Homepage or front page is what it says.
By default, what appears on the Homepage (or homepage, capitalization of the first alphabet does not matter here) in WordPress is a list of blog posts.
When a static Page is set as homepage at Settings > Reading, your site is set to have a static homepage.
Out of the box, the list of blog posts or the blog posts index appears on your site’s homepage. But this can be set to an inner page by designating a static Page as the Posts page at Settings > Reading.
This is any single blog post when being viewed on the front end.
This can be a post or a Page or a CPT post.
This is any page that shows more than 1 entry out of the box. The various archives in WordPress are category archives, tag archives, CPT archives, taxonomy archives, search archives, date archives
Every WordPress page will have a built-in query object. This contains information on what should be shown.
It is NOT recommended to alter the main query of archives if it can be avoided.
This defines how the query should be shown.
We can add our own custom (or secondary) query + loop as many times as needed in WordPress.
Sample code:
<?php
// WP_Query arguments.
$args = array(
'post_type' => array( 'testimonial' ),
'no_found_rows' => true, // when pagination is not needed.
);
// The Query.
$query = new WP_Query( $args );
// The Loop.
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
// do something.
the_title();
}
} else {
// no posts found.
}
// Restore original Post Data.
wp_reset_postdata();
?>
https://10up.github.io/Engineering-Best-Practices/php/
https://generatewp.com/wp_query/
https://gist.github.com/luetkemj/2023628#file-wp-query-ref-php
Session expired
Please log in again. The login page will open in a new tab. After logging in you can close it and return to this page.