Gutenberg or how to convert the experience of writing a post in a nightmare. The text processing point of view.

The WordPress lords had a dream they named Gutenberg however, for now, that is just a nightmare… And talking from the point of view of writing, a great and dark nightmare. But, how could something created as a step forward become a nightmare?

Lock

The answer is very easy. The idea that lies at the heart of this new invention is just the layout of the text, its visual structure of text thinking in paragraph and block of content but not in the text itself and thus, Gutenberg is a tool that allows you to format a finished text in blocks, but does not allow to treat the text as a word processor in no way, in other words, all features related to text processing have been lost. Continue reading…

Showing the Last Updated Date in wp Posts or Pages

One of the most important things currently is to be up to date, offering contrasted information and, above all, that has not become obsolete. Most WP themes show the date on which an article was created but … How can a visitor know if that content is up to date?

Computer Tapes

The answer is to show, in addition to the date of creation, the date of the last modification of any wp content. In this post I’m going to show how we can do it in a very simple way. Continue reading…

Selective enqueueing of WordPress scripts and styles through conditional loading

Both in front and back end, WordPress themes and plugins usually enqueue styles and scripts; the real cornerstone of the our work. Security systems, communications, silent or programmed operations, intelligent data process… Most of these common operations have in their backgrounds the loading of scripts and styles. Today we’re going to see how design a selective loading of these components.

Big, big tires

Habitually, the loading of scripts and styles is made by themes and plugins through the functions.php and the /root-plugin-folder/plugin-name.php files respectively. In both cases, usually there is (are) a little function in these php files that programmes the loading of all of these essential components. Continue reading…

Using Post Formats with your custom WordPress Post Types

Since versión 3.1, WordPress introduced a new theme feature called Post Formats that, basically, allows us to divide a regular WordPress Post Type in subsets based on the nature of the information that a post includes, ie, you can have regular posts, but you can also have posts that specifically contain a video, or an image, etc. In case of the Post Type post, most of the popular WP themes already includes support for styling its Post Formats but, what can we do for using Post Formats in case of our custom Post Types?

macarons

The proposed method is quite easy and it simply extends the habitually used technic for dealing with Post Formats inside WordPress templates, in other words, we’ll create a refined system for loading the content-{$post_format_slug}.php subtemplates. Continue reading…

Strategies for URL redirection in WordPress front-end pages

I know that is not a common situation but sometimes it’s necessary to redirect the current page to another URL. Inside WordPress back-end is relatively simple but from the WordPress front-end templates that shows the Posts, Pages… It’s a little more complicated.

Change direction

In this article we’ll see some strategies for redirecting the URLs, all of them based in using the WP function template_redirectContinue reading…

Using Social Icons -socicon- Font

More or less a week ago, we was talking about the font genericon, principally for constructing wonderful social menus. Genericons is a good font but if you need really add a lot of social profiles, it’s probably that you don’t find the most unknown or inhabitual profiles. If this is your case, your icons font is Socicon Font.

Using Social Icons -socicon- Font

SocIcon font is a very good font that includes more that one hundred of social profiles icons: the most known that you probably can find in any other icons font but also the most unknown, rare… So, it’s actually a good options if your website has a strong social character.Continue reading…

Examples of adding fields to WordPress Metabox

A few days ago, we was talking about how to construct a WordPress metabox for a couple of fields, today we will extend that example with several examples of code for adding different kinds of fields.

Examples of adding fields to WordPress Metabox

The fields of a regular WordPress metabox are almost always constructed using a <p></p> HTML tag so, in general, the main structure of any field for a metabox should be like this. Continue reading…

Additional Fields to the WordPress Media Uploader

In general, WordPress Media Uploader module has enogh data fields for identifying perfectly any of its elements, images, videos or whatever however, some times, you need not just identifying, for example an image, but to add some information about the exact url source, technical data about the place where it was taken, the people that appears in a photo, etc. In this cases, you need to add some more data fields to the WordPress Media Uploader.

How to add additional fields to the WordPress Media Uploader

In this example, we’re going to suppose that we want to add the name of the place where a photo was taken and, for example, the name of the client for who we are working thus, two additional fields because. By the way, if you was thinking in adding fields to keep the technical information of the photo Continue reading…

Using the Post Type description in WordPress Themes

Sometimes, especially in the case of an items list, apart from the header/title of the list, we would want to add some text as an introduction for these items: a global suggestion, perhaps a couple of interesting links, a descriptive or in detail approach about the items, a definition, etc. When the items to list are inside a Category or a Tag, to add a header with description is obvious because, simply taking a look to the screen for editing terms, all of us know that they have a description but, do you know that post types have also got a description, and that you can use it in your themes?

An example of using the Post Type description in WordPress Themes

Yes, in the same way that with the terms of a taxonomy, WordPress Post Types have also got a field to add a description thus, you can use this property of the Post Type object to introduce any text that you want and Continue reading…

Checkbox fields in WordPress Metaboxes a solution for NULL values

Talking about forms, one of the most common issues is that checkbox fields don’t return any value when they are not checked. We just receive their values -usually TRUE- when they are checked but if they are unchecked they ‘say’ nothing. What can we do?

Checkbox fields in WordPress Metaboxes a solution for NULL values

This behavior of checkboxes fields is not an error, long time ago they was designed in that way (they are silent) however, in most cases,  this behaviour is a problem because the lacking of value doesn’t allow developers to know whether there is not actually a value, or if the value is actually FALSE. There is not difference between NOTHING and FALSE so Continue reading…