WordPress Codesnippets

The Easiest Way To Find WordPress Code Solutions

Latest snippets

add page

This code creates a new page in the WordPress admin area. The first parameter is the page title, the second

Read more

get post id

The wordpress code $post_id = get_the_ID(); is used to retrieve the post ID of the current post.

Read more

get attachment

The wordpress code above is used to retrieve attachment information from the WordPress database. The $attachment_id variable is used to

Read more

get all posts

This code gets all posts from the WordPress database and then loops through each post printing the title of the

Read more

get page id

This wordpress code assigns the variable $page_id to the numeric post/page ID of the current page.

Read more

get author

The get_the_author function in WordPress allows you to easily retrieve the author of the current post. This can be useful

Read more