WPBeginner http://www.wpbeginner.com Beginner's Guide for WordPress Fri, 19 Dec 2014 18:07:17 +0000 en-US hourly 1 http://wordpress.org/?v=4.1 How to Add Additional File Types to be Uploaded in WordPress http://www.wpbeginner.com/wp-tutorials/how-to-add-additional-file-types-to-be-uploaded-in-wordpress/ http://www.wpbeginner.com/wp-tutorials/how-to-add-additional-file-types-to-be-uploaded-in-wordpress/#respond Fri, 19 Dec 2014 13:09:28 +0000 http://www.wpbeginner.com/?p=24777 For better security, WordPress allows you to only upload the most commonly used file types. You can upload commonly used image formats, audio/video, and documents using the default media uploader. But if you wanted to upload a file type that is not allowed? In this… Read More »

To leave a comment please visit How to Add Additional File Types to be Uploaded in WordPress on WPBeginner.

]]>
For better security, WordPress allows you to only upload the most commonly used file types. You can upload commonly used image formats, audio/video, and documents using the default media uploader. But if you wanted to upload a file type that is not allowed? In this article, we will show you how to add additional file types to be uploaded in WordPress.

WordPress upload error: This file type not permitted for security reasons.

File Types Allowed for Upload in WordPress

WordPress allows you to upload most common image files, audio/ video, PDF, Microsoft office and OpenOffice documents. WordPress codex has a full list of allowed file types and extensions.

Adding Exceptions for Additional File Types

Security is the main reason behind the limitation on file types that users can upload. However, this does not mean that users cannot change this. Using a tiny bit of code, you can add a new file type and extension to the WordPress. Like this:

function my_myme_types($mime_types){
    $mime_types['svg'] = 'image/svg+xml'; //Adding svg extension
    return $mime_types;
}
add_filter('upload_mimes', 'my_myme_types', 1, 1);

Notice that the file extension goes as the key in $mime_types associated array and the mime type goes as its value.

In this example, svg file extension represents files with the mime type image/svg+xml. You can find out mime types of several common file extensions on this page.

You can also add multiple file types in one code snippet, like this:

function my_myme_types($mime_types){
    $mime_types['svg'] = 'image/svg+xml'; //Adding svg extension
    $mime_types['psd'] = 'image/vnd.adobe.photoshop'; //Adding photoshop files
    return $mime_types;
}
add_filter('upload_mimes', 'my_myme_types', 1, 1);

Adobe photoshop filetype uploaded

We hope this article helped you learn how to allow additional file types to be uploaded in WordPress. You may also want to take a look at how to increase maximum file upload size in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Google+.

To leave a comment please visit How to Add Additional File Types to be Uploaded in WordPress on WPBeginner.

]]>
http://www.wpbeginner.com/wp-tutorials/how-to-add-additional-file-types-to-be-uploaded-in-wordpress/feed/ 0
What’s New in WordPress 4.1 http://www.wpbeginner.com/news/whats-new-in-wordpress-4-1/ http://www.wpbeginner.com/news/whats-new-in-wordpress-4-1/#comments Thu, 18 Dec 2014 20:57:40 +0000 http://www.wpbeginner.com/?p=24823 WordPress 4.1 was released today with many new features and improvements. This release will be the last WordPress release for the 2014, and it comes with a shiny new default theme for 2015. In this article, we will show you what’s new in WordPress 4.1… Read More »

To leave a comment please visit What’s New in WordPress 4.1 on WPBeginner.

]]>
WordPress 4.1 was released today with many new features and improvements. This release will be the last WordPress release for the 2014, and it comes with a shiny new default theme for 2015. In this article, we will show you what’s new in WordPress 4.1 and which features you should try after updating your sites.

Please note that WordPress 4.1 is a major release, so it will not get automatically updated. You will have to initiate the update. Don’t forget to backup your site before update.

Twenty Fifteen – The New Default Theme

WordPress 4.1 comes with a new beautiful default theme called Twenty Fifteen. It is an elegant, clean, but very customizable blogging theme. It was designed with a mobile first approach and it looks great on all devices. Twenty Fifteen also comes with improved support for internationalization by using Google’s Noto Font Family. The Noto font family project aims to support all unicode supported languages and scripts.

Twenty Fifteen the new default theme in WordPress 4.1

Twenty Fifteen is designed to maximize the usage of tools available in the Customizer. Users would be able to fully customize the appearance of their theme from the Customizer. Twenty Fifteen also comes with 6 color schemes to choose from.

Customizing Twenty Fifteen Theme

Revamped and Rejuvenated Distraction Free Mode

WordPress 4.1 comes with a totally revamped distraction free writing mode. Simply click on the distraction free editor button to launch and just as soon as you start writing, all the distractions on the screen will fade away.

Launching distraction free mode in WordPress

The concept behind the new distraction free writing mode is that the distractions on the post editor screens are actually very useful tools that users need while writing posts. The previous version took those tools away and in order to access those tools user had to switch back and forth.

The new distraction free editor simply fades away the meta boxes from the post edit screen, all the meta boxes fade back in as soon you move the mouse or move out of the post editor.

New distraction free writing mode

Inline Image Editing Toolbar

Many WordPress beginners have trouble understanding how to align images inside the post editor. WordPress 4.1 comes with a new inline image editing tool bar that allows users to easily align images without opening them in media editor.

Inline image toolbar

Install Language Pack and Switch Language from Admin Area

If you didn’t choose the language during installation, WordPress 4.1 allows you to change the language from the Settings » General screen. Simply select your language from the drop down menu and WordPress will install the language pack for you.

Switching WordPress to your language

Plugin Recommendations

Since 4.1, WordPress will try to recommend you plugins to try. Recommendations are based on what other plugins you have installed and what others are using. You can see the suggestions on Plugins » Add New screen by clicking on the Recommended tab.

Plugin Recommendations

Improvements for Developers

WordPress 4.1 comes with some very exciting developments aiming the developers.

Complex queries – Theme and plugin developers can now use advanced conditional logic, nested clues, and multiple operators in their meta, date, and term queries.

Title Tag – WordPress will now allow theme developers to control document title and not clash with WordPress generated title tags.

Customizer API – WordPress customizer API is aiming to build a complete JavaScript API for customizer. There are lots of improvements for contextual panels, controls and sections.

There are many more under the hood bug fixes and improvements. You can take a look at the full list of changes here.

We hope this article you an overview of what’s new in WordPress 4.1. We are particularly excited about playing with the new default theme and the customizer API. Let us know which features you liked the most?

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Google+.

To leave a comment please visit What’s New in WordPress 4.1 on WPBeginner.

]]>
http://www.wpbeginner.com/news/whats-new-in-wordpress-4-1/feed/ 1
How to Add Icons for Custom Post Types in WordPress http://www.wpbeginner.com/wp-tutorials/how-to-add-icons-for-custom-post-types-in-wordpress/ http://www.wpbeginner.com/wp-tutorials/how-to-add-icons-for-custom-post-types-in-wordpress/#comments Thu, 18 Dec 2014 13:00:02 +0000 http://www.wpbeginner.com/?p=24267 Ever wondered how you could add custom icons for your custom post types in WordPress? If so, then you’re in the right place. In this article, we will show you how to add icons for custom post types in WordPress. WordPress started using an icon… Read More »

To leave a comment please visit How to Add Icons for Custom Post Types in WordPress on WPBeginner.

]]>
Ever wondered how you could add custom icons for your custom post types in WordPress? If so, then you’re in the right place. In this article, we will show you how to add icons for custom post types in WordPress.

WordPress started using an icon font called Dashicons since WordPress 3.8. These font icons look great on any device or screen size. Well, you can leverage these icons to assign custom icons to your post types.

Adding Custom Post Type Icons using a Plugin

First thing you need to do is install and activate the CPT Custom Icon plugin. Upon activation, simply go to Settings » CPT Custom Icon Settings where you will see your custom post types listed. Next, click on the ‘Choose icon’ button next to a custom post type and then select a font from the menu.

Choosing a font for your custom post type using a plugin

Adding Icons using Custom Post Type UI Plugin

If you’re new to registering a custom post type, then we recommend that you use Custom Post Type UI plugin to create and manage custom post types and taxonomies.

Adding an icon to a custom post type created with CPT UI plugin is very simple. It supports Dashicons by default, so first you need to visit the Dashicons website and select the icon you want to use for your post type.

Copying an icon class from Dashicons website

Clicking on an icon in the list will show a larger version of the icon on the top. Next to it, you will see the icon’s CSS class. It will be something like dashicons-groups, dashicons-calendar, dashicons-cart, etc. You need to copy the CSS class and edit the custom post type you want to edit in CPT UI. All you need to do is click on the Advanced Options link and scroll down to the Menu Icon section, then paste the CSS class and save your changes.

Adding font icon in custom post type UI plugin

You can also create an image icon yourself and upload it by clicking Media » Add New. After the upload, click on the Edit link and copy the image file URL. Now simply paste this URL in the menu icon field in CPT UI settings.

Manually Adding Icon to a Custom Post Type

If you created a custom post type by placing a code in your site-specific plugin or functions.php file, then you can add menu icons manually. Once again simply visit to Dashicons website to select an icon and copy the CSS class. After this add it to your custom post type code like this:

'menu_icon'           => 'dashicons-cart',

You can also add the full URL of an image file you want to display as icon, like this:

'menu_icon'           => 'http://www.example.com/wp-content/uploads/2014/11/your-cpt-icon.png',

Here is a full code snippet that creates a custom post type called products with a menu icon:

// Register Custom Post Type
function custom_post_type() {

	$labels = array(
		'name'                => _x( 'products', 'Post Type General Name', 'text_domain' ),
		'singular_name'       => _x( 'Product', 'Post Type Singular Name', 'text_domain' ),
		'menu_name'           => __( 'Products', 'text_domain' ),
		'parent_item_colon'   => __( 'Parent Item:', 'text_domain' ),
		'all_items'           => __( 'All Items', 'text_domain' ),
		'view_item'           => __( 'View Item', 'text_domain' ),
		'add_new_item'        => __( 'Add New Item', 'text_domain' ),
		'add_new'             => __( 'Add New', 'text_domain' ),
		'edit_item'           => __( 'Edit Item', 'text_domain' ),
		'update_item'         => __( 'Update Item', 'text_domain' ),
		'search_items'        => __( 'Search Item', 'text_domain' ),
		'not_found'           => __( 'Not found', 'text_domain' ),
		'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' ),
	);
	$args = array(
		'label'               => __( 'Products', 'text_domain' ),
		'description'         => __( 'Post Type Description', 'text_domain' ),
		'labels'              => $labels,
		'supports'            => array( ),
		'taxonomies'          => array( 'category', 'post_tag' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 5,
		'menu_icon'           => 'dashicons-cart',
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'capability_type'     => 'page',
	);
	register_post_type( 'Products', $args );

}

// Hook into the 'init' action
add_action( 'init', 'custom_post_type', 0 );

We hope this article helped you add icons for your custom post types in WordPress. You may also want to check out how to use icon fonts in WordPress post editor.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Google+.

To leave a comment please visit How to Add Icons for Custom Post Types in WordPress on WPBeginner.

]]>
http://www.wpbeginner.com/wp-tutorials/how-to-add-icons-for-custom-post-types-in-wordpress/feed/ 1