Created
April 29, 2022 19:28
-
-
Save someguy9/3e2d1b7f27d5322fece2b4b8add7e0ed to your computer and use it in GitHub Desktop.
Get a post's ID based on URL in WordPress
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
<?php | |
echo 'Returning a specific post ID from a url: '.url_to_postid( 'https://smartwp.com/my-page-url' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment