With the WordPress function: wp_get_attachment_image_src, you can get the src of the featured image. Instructions Add this code to your page/post template file where you want to use the featured image source.
This snippet automatically sets the featured image by fetching the first image of the WordPress post.
Heres a little snippet that will display recent posts from a specific category in WordPress
Heres a little trick on how to show a list of the most popular WordPress post by post read count - without using a plugin.
If you wanted to add emphasis to the first post in your blog adding this snippet to the functions.php of your wordpress theme will add the class of “first” to your first post. Instructions Add this code to your functions.php file.
This snippet will allow contributors to upload images on your wordpress site.
This snippet is very handy if you wish to add category ID to body and post class for ex. targeting CSS styles and such.
Put this in the theme post-/page file to make an “Edit Page” or “Edit Post” link in your template file – that takes you into the admin page-/post edit mode. This link will only be visible when the viewer is logged in and has appropriate permissions to edit that page (administrator or author). Related …