Creating a Table of Contents for your Pages

WordPress has got the hability to work with nuclear posts and also with posts that can contain other posts, ie, posts with hierarchical structure, the pages. Today we’re going to see how to create a hierarchical list of the second ones, as an index of pages, Table of contents (TOC), etc.

Panzerbaum

As default, WordPress supports two different kinds of elements: posts and pages. The basic difference between them is that the first ones are treated as individual elements and thus, when WordPress displays a collection of them, this will be just a long linear list of elements (like the natural numbers 1, 2, 3, 4, for example) meanwhile the second ones have got a hierachical structure, ie, each element can contain (to point to) elements that have also got hierarchical structure and can contain (to point to) other elements and so on, in consequence, when WordPress displays a collection of them, it should be always presented as a tree and never as a list. Continue reading…

Marking all external links for opening in a new Tab Browser

Normally, it’s while you are writting a post, when you mark the links inside the text as normal or “for opening in a new Tab or Browser” –typically the external links–; simply you mark the checkbox Open link in a new Tab in the Links Tool of WordPress Editor but what does it happen if you have already got a lot of posts non marked, or if you have changed the criteria for external links, or whatever similar situation?

Food Camera and Backchannel: MIT Media Lab lists

Well, the long solution consists of editing all posts and to locate and to correct manually the external links but, if you have more than a hundred of posts with a lot of links probably, it will be an very stressing task, and surely, you’ll forget some of them… Continue reading…

How to suppress the emoji module?

As the WordPress documentation says, Emoji are the ideograms or smileys (for example 🙂 ) used in electronic messages and Web pages. Originating in Japan on mobile devices, they are now commonly available on devices worldwide, ranging from mobile to desktop computers. Emoji are decorative, useful and they can actually make any website more friendly, maybe for this reason, the Emoji module is added as default by WordPress to all Themes but, what can we do if we don’t want to load this module?

Emoji keyboard example for Android by Kraftbj on WordPress

The WordPress Emoji module is independent of any theme, and just depends on two files (a little CSS code and a script) that are tipically added to the HTML <head> element. This addition is made through two functions Continue reading…

Adding a fixed text or element to all posts. The “the_content” filter

We often need to add a fixed text or html element to the text of all posts: a signature, a link, a little logo, even a form. In fact, there are some ways to do this task but perhaps the easiest way is to use the the_content filter.

Basic schema of operations for the_content filter

The the_content filter –in general any WordPress filter– is a kind of funnel through which WordPress passes the post_content before being displayed on screen. Using this funnel (filter), ie, adding operations inside it, we can change de content of the post_content field for all Posts but for doing this we have to do two operations. Continue reading…

A different style for the external links

Sometimes inside a post or a page you have to include a link whose url doesn’t belong to your website; a external link is called. In most cases, this kind of external links are styled in the same way that the rest of internal links (links to your own website) and, in consequence, the readers can’t distinguish between them. Now, a simple method for styling your external links.

Styling external links in a different way. An example.

Our first step is to find out what is the basic difference between these two kinds of links because  Continue reading…