Home
Add Document
Sign In
Create An Account
Slides from this workshop
Download PDF
Comment
Report
4 Downloads
176 Views
Custom Loops with WP_Query Zac Gordon @zgordon
The WordPress Loop
• Code in a template file • Checks for available content • Includes markup for content • Quite intelligent
@zgordon
Sometimes the Loop Isn’t Enough
WP_Query Function
• Goes before the loop • Accepts parameters • Customizes the loop • Quite powerful
@zgordon
Let’s Get Setup
Getting Setup
• Local WP Install • WP Example Content • Advanced Custom Fields & Custom Post Type UI
• 2012 Child Theme
@zgordon
How it Works
WP_Query
• Make a child page.php • Reset the loop and add WP_Query • The Codex documentation • Try some examples
@zgordon
WP_Query Examples
• categories and tags
• post types
• search keyword
• status
• custom fields
• random order
• get post or page
• orderby title
• get child page
• date range
@zgordon
Questions? @zgordon
Recommend Documents
slides - Fantastic 5G Workshop
Distribution workshop slides
×
Report Slides from this workshop
Your name
Email
Reason
-Select Reason-
Pornographic
Defamatory
Illegal/Unlawful
Spam
Other Terms Of Service Violation
File a copyright complaint
Description
×
Sign In
Email
Password
Remember me
Forgot password?
Sign In
Login with Facebook
Our partners will collect data and use cookies for ad personalization and measurement.
Learn how we and our ad partner Google, collect and use data
.
Agree & Close