Lesson 6 – Using Secondary WordPress Loops
Facebook
LinkedIn
Google+
This is the sixth lesson in our Customize Genesis Like a Pro video tutorial course but it’s also the fourth lesson on how to customize the Genesis Theme using PHP. Here you’ll learn how to use Secondary WordPress Loops. We begin with what a WordPress Loop is and how it works. We show several ways to create a them and what parts they are made up from. Then we take you through 5 examples of ways to use WordPress Loops to customize your site.
- The process of getting information from the database and displaying it on the page
- Loops in action
- The page loop – simple loop, retrieves one piece of information
- The single post loop – the same
- Blog page loop – retrieves several posts and loops through them
- Archive page loop
- The main loop
- Retrieves the primary content of the page
- Can contain secondary loops
- Secondary loops
- Any other loop besides the main loop
- Examples of secondary loops
- comments
- widgets
- byobwebsite examples
- Create the function
- Define the Query Parameters
- Write the query
- Configure the output
- Clean up
- Define the hook
- Test
- Add Genesis HTML
- Several ways to create a secondary loop
- query posts – this is the main query object
- WP Query – the preferred method
- Creates a new query
- Separate from the main query
- 4 parts of a Secondary Loop
- Define the query parameters
- 2 methods of annotation
- query string
- associative array
- variable
- associative array
- The query
- Display the results
- Clean up
- WordPress Query Parameters
- Taxonomy Parameters
- Category parameters
- Tag parameters
- Custom taxonomy
- Page type parameters
- Post
- Page
- Post type
- Archives
- Post meta parameters
- Pagination parameters
- Category query parameters
- get_the_title()
- the_permalink()
- Add a heading
- Add multiple loops with different criteria
- get_the_post_thumbnail() function
- Link the image to the post
- get_permalink();
- get_the_title();
- The hook
- Set priority
- Set pagination
- Borrow Genesis HTML
- Custom post type query
- Display the ‘output’ element of the array
- Link the image to the post
- get_permalink();
- get_the_title();
- thesis_post_image_info function
- Display the ‘output’ element of the array
- Link the image to the post
- get_permalink();
- get_the_title();
Save $200 on Membership Now!
Start learning today for as little as
$0.82 PER DAY!
THIS IS A LIMITED TIME OFFER!
Subscription Options
Facebook
LinkedIn
Google+