• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WPGist

WordPress Gist and Snippets Collection

  • Home
  • Gists
  • Blog
  • Contact us
  • Submit
You are here: Home / Gists / Get Post Info by Slug

Get Post Info by Slug

By Rogger Shaw Leave a Comment

Pull the ID first, then you’ll have access to the post’s data.

Usage:

If you only have a post’s slug, you can easily get the ID of it, and than pull that post’s info. Useful for when you can only get a post’s slug, but need to get more info for that post.

Filed Under: Gists

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • Facebook
  • Twitter

Latest Gists

  • Create a WordPress While Loop
  • Enqueue WordPress Scripts and Styles
  • Get Post Info by Slug
  • Get Image URL from Image ID
  • Create a Search Shortcode

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

© 2025 · WPGist · All rights reserved · A Project of WPArena.com