Powered by Blogger.

Popular Posts

Wordpress 4.4 Cool New Features 2016

WordPress 4.4 has just been released today and we played around with this latest new offering to see what new shiny features we could find. This new version is shipped with quite a few improvements that are set to make WordPress developers go crazy. It may even eventually shape the future ofWordPress in the JavaScript-centric era.
In this post we will be looking at 10 new WordPress 4.4 features you should be checking out.

1. Embed Posts Anywhere

For years, you can embed content on your website, like a YouTube video or a tweet via the use of a feature called oEmbed. Well, the good news is WordPress has adopted this feature in 4.4 and you can now easily embed content anywhere on your site just by grabbing the URL of a post and pasting it into the content editor. A preview of the post that you embed will appear on your page, something like this:
If for some reason, you feel that you don’t want to use this feature, then you can disable it by installing the disable embeds plugin.

2. Work With Responsive images

As devices and their screens grow larger, designers must work with larger images as well. The bad news is that this contributes to slower page loading times. So it’s probably good timing that WordPress now supports responsive images on your theme.
Test image using Responsive Web Design Testing Tool
In this update WordPress has added two more atributes to your images on top of class attributes for alignment (left, center or right): srcset and sizes. These attributes allow the images on post thumbnails, photo galleries and other images to be delivered in the proper size based on the viewport.
Thus, on every image you will see the output source code like so:
1
<img class="alignnone size-full wp-image-15 below-entry-meta" src="http://yoursite.com/wp-content/uploads/2015/11/horse.png" alt="horse" srcset="http://yoursite.com/wp-content/uploads/2015/11/horse-300x217.png 300w, http://yoursite.com/wp-content/uploads/2015/11/horse-768x556.png 768w, http://yoursite.com/wp-content/uploads/2015/11/horse.png 868w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" height="628" width="868">

3. New Theme: Twenty Sixteen

Twenty Sixteen is a brand new default theme for WordPress 4.4. It is designed to take on the traditional blogging format.
Twenty Sixteen works perfecty for blogs or websites, featuring optional sidebars, custom color options with beautiful default color schemes, harmonious fluid grid, overflow displaying large images, ability to add intro to post using custom excerpt, and other polished features.

4. Introduction to the REST API

WordPress 4.4 brings the REST API infrastructure into the Core. This API handles the routing, argument handling, JSON serialisation, status codes, as well as functions to create custom REST API endpoints. This is fantastic news for developers. With this infrastrucure developers are finally able to build their own APIs for their themes, plugins, even mobile or desktop apps.
Head over to this page, Adding Custom Endpoints, to learn how to register a custom API endpoint.

5. Custom Term Taxonomy Meta

In previous versions of WordPress we can add custom field to the post and pagesthrough the term meta. Now WordPress has added this feature to taxonomy objects.
For example on the Category taxonomy we might want to add a custom field, namely category image to feature the post’s featured image on each category. In this version we can do this by making use of the following functions:add_term_meta()update_term_meta()delete_term_meta(), andget_term_meta().

6. Single Post Template File

In this version, WordPress included a new template file on theme hierarchy to be used as a single post or custom post type. This feature is useful when you are targeting a specific post, to give ‘special’ styles to that page so it will look different from other pages. You will have a template file with a name like below:
single-{post_type}-{post_name}.php
For example, here I have a custom post type named book that I want to spruce up for a "bestseller book" post. So I creat single-book-bestseller.php then tweak the style to be applied to this page only. Lastly, I change the post slug toyoursite.com/book/bestseller to apply the special page.
LEFT: Standard book post, RIGHT: Best seller book post

7. Improved Comments

WordPress has made rearrangements on the comment form, where the comment field is displayed first, then the name and email fields below. This improvement was the answer to the issue that the comment behaviour is different for logged in and logged out user.
On the backend, the comment now is represented by the WP_Comment object. This enables you to output comments in a more object-oriented (OOP) way with more powerful comment queries.

0 comments:

Post a Comment