Blog

Posts tagged with "WordPress"

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:

How to make site link on WordPress admin bar open in new tab

Add the snippet below to your themes functions.php file to make the site name link on the WordPress admin header open in new tab.

function wp_admin_bar_site_link( $wp_admin_bar ) {     $node ...

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