Sometimes you need to display post-specific content using custom fields. In this example we will show you how you can display custom field data using conditional statements in the form of a youtube video embed. If the post has a "youtube-video-link" defined, the content will be rendered.
Category: Code Snippets
If you only wish to show content only on the WordPress front page, you can do so by wrapping the content in a is_page (is_front_page) conditional statement. You can also choose to display content on all pages BUT front page by adding “!” to your statement. Instructions Insert content as shown below. Related Links: …
Expose the Wordpress "img src" part from the get_the_post_thumbnail, to modify the "img src" syntax.
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.
Heres a little tip on how to display a list of WordPress authors with avatars and username
Heres a little trick on how to remove the WordPress author prefix from the author slug (URL).
Heres a little trick on how to add custom WordPress user profile fields
This WordPress snippet will add a class to the first post in the WordPress loop.