This WordPress snippet will allow you to insert WordPress shortcodes into your theme-/templates - using WordPress built-in function do_shortcode()
Category: Code Snippets
This snippet will let you define a new default excerpt length for the WordPress excerpts output. The following example will set the default excerpt length to 20 characters.
This WordPress snippet will let you show a list of post by a specific user. This is useful if you for example want to show post from a specific user on Custom Post Types etc.
Custom post types are not included in the WordPress search results by default - this snippet allows specific custom post types to be queried and searched by WordPress.
How to output content based on WordPress meta fields - and use conditions (statements) based on wether or not the meta fields has data
This snippet will use WordPress built-in "mobile detect" function "wp_is_mobile" to create a simple shortcode that can hide certain parts of your content from mobile visitors and-/or desktop visitors.
To display the Wordpress site(blog) name and description - you can add the following to your template.
The WordPress JSON REST API can be useful for developers building apps using WordPress. Other site owners may find it unusable - and it could also potentially expose your website
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.
Here is a snippet that will enable you to show a short intro (excerpt) of the WordPress author bio of a post and not the complete bio. With this snippet you can make an excerpt of the author bio, with a link to the author page, where you can see the full bio. Instructions Add …