Snippets category

Retrieve Attachment ID from Image URL

February 22, 2014 in Snippets

What if you only have image URL, but you need attachment ID or different size of image? WordPress by default don’t have a function for retrieve attachment ID from Image URL, but with a few lines of code you can solve it

Read more »

Return Top Parent ID of Page/Post

February 19, 2014 in Snippets

When you work with pages (or posts), sometimes you want to find a top parent ID of a current page or post. This can be useful, for example, if you want to show sub navigation in sidebar.

Read more »