Customize WordPress Tag Cloud Widget

Terakhir diperbaharui: Kamis, 25 Agustus 2016 pukul 15:12
Tautan: http://darto.id/2z

There are plenty of ways of adding a custom widget, or hacking WordPress core files to achieve what I needed but that isn’t very efficient; especially when it comes time to update the WordPress install.

Instead, I took advantage of filters, specifically widget_tag_cloud_args. You can find the different parameters for the wp_tag_cloud in the Codex since that’s what we’ll be working with here.

Open up your themes functions.php file and add the following:

Changing the Smallest and Largest Font Sizes

By default, the tag cloud displays tags by point (pt); the smallest being 8pt and the largest being 22pt. Let’s change that to 10px and 18px respectively:

function custom_tag_cloud_widget($args) {
	$args['largest'] = 18; //largest tag
	$args['smallest'] = 10; //smallest tag
	$args['unit'] = 'px'; //tag font unit
	return $args;
}
add_filter( 'widget_tag_cloud_args', 'custom_tag_cloud_widget' );

 

Changing the Total Number of Tags to Display

By default the WordPress tag cloud only shows 45 tags. We can change that to display a specific number or all tags by adding the following to the function we added above:

function custom_tag_cloud_widget($args) {
	$args['number'] = 0; //adding a 0 will display all tags
	$args['largest'] = 18; //largest tag
	$args['smallest'] = 10; //smallest tag
	$args['unit'] = 'px'; //tag font unit
	return $args;
}
add_filter( 'widget_tag_cloud_args', 'custom_tag_cloud_widget' );

 

Changing the Tag Cloud Format

By default the tag cloud displays tags in a flat format seperated by whitespace. Let’s change that to an unordered list with a class of wp-tag-cloud:

function custom_tag_cloud_widget($args) {
	$args['number'] = 0; //adding a 0 will display all tags
	$args['largest'] = 18; //largest tag
	$args['smallest'] = 10; //smallest tag
	$args['unit'] = 'px'; //tag font unit
	$args['format'] = 'list'; //ul with a class of wp-tag-cloud
	return $args;
}
add_filter( 'widget_tag_cloud_args', 'custom_tag_cloud_widget' );

 

Exclude Tags from the Tag Cloud

We can also exclude tags from showing up in the tag cloud by adding the following:

function custom_tag_cloud_widget($args) {
	$args['number'] = 0; //adding a 0 will display all tags
	$args['largest'] = 18; //largest tag
	$args['smallest'] = 10; //smallest tag
	$args['unit'] = 'px'; //tag font unit
	$args['format'] = 'list'; //ul with a class of wp-tag-cloud
	$args['exclude'] = array(20, 80, 92); //exclude tags by ID
	return $args;
}
add_filter( 'widget_tag_cloud_args', 'custom_tag_cloud_widget' );

 

Add Custom Taxonomies to the Tag Cloud

By default the tag cloud only shows the post_tag taxonomy. Let’s also add a custom taxonomy called ‘ingredients’:

function custom_tag_cloud_widget($args) {
	$args['number'] = 0; //adding a 0 will display all tags
	$args['largest'] = 18; //largest tag
	$args['smallest'] = 10; //smallest tag
	$args['unit'] = 'px'; //tag font unit
	$args['format'] = 'list'; //ul with a class of wp-tag-cloud
	$args['exclude'] = array(20, 80, 92); //exclude tags by ID
	$args['taxonomy'] = array('post_tag', 'ingredients'); //add post tags and ingredients taxonomy
	return $args;
}
add_filter( 'widget_tag_cloud_args', 'custom_tag_cloud_widget' );

Pretty simple, no?

 

source: designpx

AppCleaner

Terakhir diperbaharui: Kamis, 25 Agustus 2016 pukul 15:12
Tautan: http://darto.id/30

AppCleaner is a small application which allows you to thoroughly uninstall unwanted apps.

Installing an application distributes many files throughout your System using space of your Hard Drive unnecessarily.
AppCleaner finds all these small files and safely deletes them.

Simply drop an application onto the AppCleaner window. It will find for the related files and you can delete them by clicking the delete button.

Pengajian Meresahkan Warga

Terakhir diperbaharui: Kamis, 25 Agustus 2016 pukul 15:12
Tautan: http://darto.id/31

Pelapor: “Pak Polisi, di daerah kami ada pengajian Salafy. Tolong dibubarkan karena meresahkan warga.”

Polisi: “Meresahkan gimana? Memang mereka nyetel musik nyaring2?”

Pelapor: “Gak Pak. Kata mereka musik itu haram.”

Polisi: “Terus? Oh, saya tahu. Pasti mereka ngajak demo ya?”

Pelapor: “Gak Pak. Kata mereka kita harus ta’at pada pemerintah Muslim.”

Polisi: “Atau tawuran?”

Pelapor: “Gak Pak. Mereka bilang haram mengacungkan senjata ke orang Islam.”

Polisi: “Ngajakin ngebom ya?”

Pelapor: “Bukan juga, Pak. Katanya membunuh kafir non-Harby itu haram.”

Polisi: “Oooh. . . Pasti mereka lagi pesta sex?”

Pelapor: “Bapak jangan ngawur, wong wanitanya ada ruangan sendiri.”

Polisi: “Biasanya pengajian meresahkan itu karena dzikir berjamaahnya pake mikrofon?”

Pelapor: “Gak Pak. Kata mereka itu bid’ah!”

Polisi: “Apa suara kasidahan ibu2nya jelek?”

Pelapor: “Sudah saya bilang mereka gak suka nyanyi!”

Polisi: “Terus? Kenapa mesti saya bubarkan?”

Pelapor: “Karena begini, Pak. Karena mereka itu. . . . Karena. . . . Begini lho. . . . Hmmm. . . Apa ya?”

Polisi: “Bapak silahkan buat laporan yang jelas dulu. Allah berfirman, “La taqfu ma laysa laka bihi ‘ilm”. Jangan mengikuti apa yang kamu tidak tahu ilmunya.”

Pelapor: “Wah, ternyata bapak pinter agama, hafal ayat juga. Ikut kajian dimana, Pak?”

Polisi: “Kajian Salafy.

Dia – Diagram Editor

Terakhir diperbaharui: Kamis, 25 Agustus 2016 pukul 15:12
Tautan: http://darto.id/32

Dia is free (open source) drawing software. Sketch your favorite structured diagrams!. The current Dia release has been tested successfully on Windows 8.1, 8, 7, Windows Vista and Windows XP, Linux and Mac OS X.

Convert m4a to mp3 with iTunes

Terakhir diperbaharui: Kamis, 25 Agustus 2016 pukul 15:12
Tautan: http://darto.id/33

I use iTunes 11.3.1.2 to convert m4a (voice memos) to mp3.

Open iTunes and go to Preferences by click little box at left top iTunes.

iTunes Preferences

At General Preferences click Import Settings…

General Preferences

And choose Mp3 Encoder.

Import Settings

And then back to iTunes Music and right click to file or song that you want convert to mp3.

Convert m4a to mp3

And thats it, your file just converted to mp3.