Filter and Hooks, Programming

Issue : Outlook Overriding Font from Arial to Times New Roman

If your are receiving the email on Outlook in Times New Roman, add the following code inside the head tag.

If you are facing the similar issue in CF7 (contact form 7),  just attach the script in the body using CF7 filter.

P.S. This resolved my issue ūüôā .

Hits: 43

Filter and Hooks, Programming, WordPress

Remove special character while uploading Media

The media having special characters in its name,  may not be visible in the front-end, therefore, we should remove the special character while  uploading media in the WordPress dashboard.   wp_handle_upload_prefilter, is admin filter that is called by the wp_handle_upload function, which helps to alter the filename before the file is moved to its destined location. The sole parameter $file, represent a single element of the $_FILES array.

Adding the aforementioned filter in the function.php, removes the special character from the name of the media prior to uploading it in WordPress dashboard.

Hits: 18

Filter and Hooks

SQL Query to get the archive / year by post type

For listing the published year of the particular post type, we can use the SQL as presented below.

Replace the ‘post_type’ with your own post type.

Hits: 7

Filter and Hooks

Sort the categories in an alphabetical order in the presence of plugin

”Category Order and Taxonomy Terms Order’ plugin’, ¬†order Categories and all custom taxonomies terms (hierarchically) using a Drag and Drop Sortable javascript capability. ¬†When the condition arrives, where we want ¬†to order particular ¬†categories / taxonomies ¬†in the ¬†alphabetical order, then we can use the ksort. Check the example :


Hits: 5