Last active
June 30, 2022 15:27
-
-
Save steroyle/7c436d2c03172490eed1a9d50588215f to your computer and use it in GitHub Desktop.
Get a list of WordPress post using a page template and the name of the template.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
wp_postmeta.post_id, | |
wp_postmeta.meta_value, | |
wp_posts.post_title, | |
wp_posts.post_name | |
FROM | |
wp_postmeta | |
INNER JOIN wp_posts ON wp_postmeta.post_id = wp_posts.ID | |
WHERE | |
meta_key = "_wp_page_template" | |
ORDER BY | |
meta_value ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment