Tumblr themes & Custom Content Shortcode

Anyone who has ever tried to build a WordPress theme will appreciate the simplicity and flexibility of Tumblr themes.

A few years back (it must have been around 2012) my friend Jose Morraja asked me to create a Tumblr theme for him. I was amazed not just by the simplicity of its conditional and content tags, but by the fact that you could do all of these, plus mapping a subdomain, on a 100% free site.

You can see an example of these conditional and content tags below:

{block:IfLogoImage}
  <h1><img src="{image:Logo}"/></h1>
{/block:IfLogoImage}
{block:IfNotLogoImage}
  <h1 class="cropped"><a href="/">{Title}</a></h1>
{/block:IfNotLogoImage}

Meet my favourite plugin

This pseudo-code approach reminds me of one of my favourite plugins EVER: Custom Content Shortcode by Eliot Akira

You have never seen loops like these, trust me.

Custom Content Shortcode will let you create “pseudo-code” loops using a million options.

From featured images for Custom Post types from a certain category & term:

[loop type=cpt_name taxonomy=custom_taxonomy_name term=sometermname]
<li>[field image size=medium]</a></li>
[/loop]

Linked featured image and title of all child pages for a given parent page, including ACF custom fields:

[loop orderby=date order=ASC type=page parent=86]
<li class="childpage">[field image-link size=medium]
<h3>[field title-link]</h3><
<p>[field acf_customfield_name]</p>
</li>
[/loop]

List terms in a taxonomy:

[for each=custom_taxonomy_name]
 <li class="term">[each name]</li>
[/for]

The plugin has its own system to create meta-shortcodes and simplify their usage:

The plugin lets you loop through users and supports pagination and conditonal logic. It even allows to pass variables and paremeters, you can read all about it here.

[if field=date before='106 weeks ago']This is an old article[/if]
[is login]
  You are logged in.
[else]
  You are not logged in.
[/is]
Sigue leyendo “Tumblr themes & Custom Content Shortcode”

El País, being silly.

Sillier than usual, that is.

The most important (ok, most read) newspaper in Spain, El País, is telling me that they will decide on how I must use my browser to visit them, and which add-ons I can and cannot use.

I hardly ever visit this silly website anyway, but I do not like people telling me how to use my stupid browser. Specially if they are going to get all silly about it. Here is what I got today:

Please, disable your adblocker, subscribe or fuck off.

Yours silly, El País.
There is not even the faintest attempt to explain why I should agree or go along with this, hence the «fuck off» part.
Leer más (no hace falta pagar)

Gutenberg VS Page Builders

Stackable blocks and tupperwares FTW!

Feminist views vary regarding the Tupperware format of sales through parties, and the social and economic role of women portrayed by the Tupperware model. Opposing views state that the intended gendered product and selling campaign further domesticates women, and keeps their predominant focus on homemaking.[26] 

The positive feminist views consider that Tupperware provided work for women who were pregnant or otherwise not guaranteed their position at work due to the unequal gender laws in the workplace. The company promoted the betterment of women and the endless opportunities Tupperware offered to women; whereas, the negative view includes the restriction of women to the domestic sphere and limiting the real separation between running the household and a career.[5] 

The emergence of Tupperware in the American market created a new kind of opportunity to an entirely underrepresented labor demographic; women, and especially suburban housewives.

Tupperware – Wikipedia

Instagram API fail

I set up this Instagram Feed plugin on my cousin’s site, who just happens to be my friend on Instagram. Apparently her account was not working and the plugin decided to fallback on the site admin’s email account… or something.

The oddest part is that my Instagram Feed is private but because Maria can see my feed and the APP was registered with her account, this meant my private Instagram photos were displaying publicly. Speak of an API fail.

Using a tag to create a reusable “fake” author in WordPress

I was posting an article on behalf of someone else who did not have a WordPress.com user and I wanted to show their name in the “Author” box.

This would be trivial to do using pseudoelements (:before & :after) and throwing the post id (postid-3735) into the selector to make sure the CSS rules only applies to that specific post, like this:

.postid-3735 .author {
	font-size:0;
}
.postid-3735 .author:after {
	font-size:18px;
	content:"John Doe";
	pointer-events:none;
}

The problem with this approach is that cannot be reused. Instead what I did was to create a tag with the name of the author of the post.

By doing this I made sure a new CSS class would be added to the article containing the post whenever this tag was used

And this, in turn, allows me to use this selector:

.tag-carlos-fernandez-liria .author {
	font-size:0;
}
.tag-carlos-fernandez-liria .author:after {
	font-size:18px;
	content:"Carlos Fernández Liria";
	pointer-events:none;
}

Finally, I also added the pointer-events:none property to prevent the Name of the author from being clickable, as it would take to my own author posts page.