Display a list of posts in WordPress.com

To embed a list of posts in WordPress.com, display-posts shortcode is the way to generate this list. While WordPress.com already have a great documentation for this shortcode, I am going to highlight some extremely useful ones and add some notes to them:

[display-posts author="your_username"]
This display a list of posts published by given author.
Note: the author attribute is taking username, not the display name

[display-posts category="category_name"]
Display a list of posts belong to certain category(s)
The category name is not case-sensitive, so if you have a category name such as Admin's Log, then category="admin's log" or category="ADMIN'S LoG" works fine too. Notice it accepts special character as well 😉

[display-posts tag="tag_name"]
Display a list posts belong to certain tag(s)
If you want a list with mutiple tag, just add a comma in between: tag = "tag1, tag2"

[display-posts include_excerpt="true"]
Display a list of your posts with a short excerpt

[display-posts include_date="true"]
Display a list of your post name with date => (month/day/year)

[display-posts wrapper="ol"]
Display the list in ordered list
Note: 3 options: uloldiv. => default is ul

[display-posts posts_per_page="20"]
Display a list of posts with 20 items. If this attribute is not specified, the default value is 10
-1 means display all posts; having that said, display-posts has a limit of 100 items, so the following attribute will help

[display-posts offset="20"]
Display a list of posts starting on the 20th item



And of course, you can join these attributes together and have something like:

[display-posts category="category_name" tag="tag_name" posts_per_page="3" include_excerpt="true" include_date="true"]

And I would get:

  • Hide directory tree in Apache server (3/1/2015) - Take me hours to figure this crap out. Anyways, here’s the short story:   Open apache configuration file: sudo nano /etc/apache2/apache2.conf   Scroll down to the <Directory /var/www/>. Add Options -Index and comment Option Indexes FollowSymLinks like so: <Directory /var/www/> Options -Indexes # Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>   That’s all … Continue reading
  • Server Setup on Instances (3/1/2015) - Install Apache sudo apt-get install apache2-mpm-prefork sudo a2enmod userdir sudo a2enmod expires Restart Apache sudo /etc/init.d/apache2 restart sudo service apache2 restart Install MySQL sudo apt-get install mysql-server mysql-client Create DB user in MySQL CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; CREATE DATABASE db_name; GRANT ALL ON db_name.* TO 'username'@'localhost'; Install PHP sudo apt-get install php5 libapache2-mod-php5 … Continue reading
  • Linux Commands (10/23/2014) - Remove directory and all the files/folders in it: rm -rf <folder_name> Copy a directory and all its contents: cp -a /source/. /dest/ Git commands Stage only modified files and not untracked ones git add -u Commit git commit -m 'your_message'


To find out more about this shortcode: https://en.support.wordpress.com/display-posts-shortcode/

Have fun with WordPress.com!!


How to show posts with text widget when on certain category in WordPress.com

So you may or may not notice from my site that there is a text widget that lists all the posts if you are reading certain posts that belong to a category. It doesn’t show up on all pages. For example:

Notice that the text widget on the left doesn’t appear on every page. The widget only showed up because the post currently belongs to that category.

Here’s how you set it with 5 simple steps!

Step 1. Go to Widget page in the Admin tool

Step 2. Add a new text widget and give it a title

Step 3. In the text widget body, you can use the following shortcode to display all the title of the posts under a particular category:
[display-posts category="Your Category Name" posts_per_page="-1"]

Step 4. Click on Visibility button down beside Save

Step 5. Set the condition to match your category selection

Hope this helps! 😀


Note for Step 3:
category name must be the exact matching name (i.e. case sensitive and space). -1 for posts_per_page means to have no limit of posts being display.

Find out more about WordPress.com display-posts attribute 



How to Embed Youku Videos to WordPress

First, you wanna copy the html code from youku’s share function:

<embed src="http://player.youku.com/player.php/sid/XNDYwMTEzMTY0/v.swf" allowFullScreen="true" quality="high" width="480" height="400" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>

Then, take the url and convert to the following:

[gigya src="http://player.youku.com/player.php/sid/XNDYwMTEzMTY0/v.swf" allowFullScreen="true" quality="high" width="480" height="400" allowScriptAccess="always" ]

You can change the width and height as well as the other attributes

Source: justpi’s solution

WordPress Clock Widget

Since this is a little cool thing on WordPress, I just thought maybe I should make a note for myself and share with you guys out there who are interested on putting a clock on your sites. I figured that I need it because I procrastinate too much and produced too many half-ass projects… GOD~ Not like a clock on the website will help, but.. it’s cool.

This is just a list of clocks that I kind of like. Use google to search up more if the ones below doesn’t satisfy your taste. Here we go!


[gigya src="http://www.widgipedia.com/widgets/Flash2nd/Portal-Analog-Clock-5412-8192_134217728.widget" width="200" height="200" quality="high" wmode="transparent"]
[gigya src="http://www.widgipedia.com/widgets/Flash2nd/Deep-Blue-Clock-5414-8192_134217728.widget" width="200" height="200" quality="high" wmode="transparent"]
[gigya src="http://www.widgipedia.com/widgets/jeanphi/globe-clock-4205-8192_134217728.widget" width="200" height="200" quality="high" bgcolor="#afc0d4" wmode="opaque"]
[gigya src="http://www.widgipedia.com/widgets/jeanphi/papillon-clock-2_-4055-8192_134217728.widget" width="200" height="200" bgcolor="#ffffff" wmode="opaque" quality="high"]
[gigya src="http://widgia.com/widgets/butterflyclock2/butterflyclock2.swf" quality="high" width="200" height="200" ]


[gigya src="http://stuff.freeflashtoys.com/swf/digit.swf?myc=37030" width="250" height="84" quality="high" wmode="transparent"]
[gigya src="http://widgia.com/widgets/flip_clock/flip-clock.swf" width="250" height="120" wmode="transparent"]
[gigya src="http://widgia.com/widgets/toolshell/flash_clock.swf" width="250" height="250" quality="high"]
[gigya src="http://widgia.com/widgets/vista_clock/vista_clock.swf" width="250" height="200" quality="high" wmode="transparent"]
[gigya src="http://i251.photobucket.com/albums/gg294/wafpaf/clocks/swf/digitaldatetime2.swf" width="250" height="120" quality="high"]
[gigya src="http://widgia.com/widgets/welcome_time/welcome.swf" width="400" height="150" quality="high"]
[gigya src="http://flash-clocks.com/free-flash-clocks-blog-topics/free-flash-clock-42.swf" width="300" height="200" wmode="transparent"]