Blog

How to add featured images to a custom post type or page

This snippet will add featured images to a custom post type or page in WordPress.

Just add the code below to your themes functions.php file replacing “your_custom_post_type” with yours.

add_theme_support('post-thumbnails', array(     ...

see full post
tags:

How to get an excerpt of a WordPress post by ID

Add the snippet below to your themes functions.php file to get an excerpt of a WordPress post by ID

function get_excerpt_by_id($post_id){     $the_post = get_post($post_id);     $the_excerpt = $the_post->post_content; ...

see full post
tags:

How to make WordPress search in a singular post type

This snippet will make the WordPress search function only return items that are a single post type. (posts, pages, custom posts types)

Just add the code below to your themes functions.php

function SearchFilter($query) ...

see full post
tags:

How to remove widgets from WordPress admin dashboard

Add the snippet below to your themes functions.php file to remove ALL of the widgets from the WordPress admin dashboard.

remove_action('welcome_panel', 'wp_welcome_panel'); function remove_dashboard_widgets() {     global $wp_meta_boxes;     unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);   ...

see full post
tags:

How to remove the version number in the WordPress admin footer

Add the snippet below to your themes functions.php file to remove the version number in the WordPress admin footer.

function hide_version_number() {     remove_filter( 'update_footer', 'core_update_footer' ); } add_action( 'admin_menu', 'hide_version_number' );

see full post
tags:

welcome to the eudemonics blog ...

you can find posts about the things i've been working on, useful code snippets and articles relating to my interests.

comments can be left at the bottom of each post, if you wish to contribute to an article please get in touch.

Blog Categories

Blog Tags