Category Archives: Wordpress

Code Snippet: WordPress Nginx Configuration File With SSL Enable

WordPress is running smooth with Nginx. I have a server with DigitalOcean and currently use WordPress with Nginx. Here is the code snippet for Nginx configuration with SSL enable.

To use this code snippet, you are required to have a valid SSL installed on your server. After that replace example.com on the configuration code above with your own domain.

credit

WordPress Varnish Cache Age 0

Varnish with cache age 0 means that varnish did not serve the content from cache.

To solve this, edit your sudo nano /etc/varnish/default.vcl

paste this in that file.

After that restart varnish service,

sudo service varnish restart

you may check your varnish status here

WordPress: Change Contus Video Gallery Player To Recent Video

Contus Video Gallery is a super-awesome video gallery plugin for wordpress. Read more here.

By default, Contus video gallery will show recent featured video in homepage video player. Instead of recent featured video, we will change it to the most recent video from all categories. (The most recent upload video)

To show the latest video in the home page player, go to file path ../wp-content/plugins/contus-video-gallery/front/models/videohome.php

In this file finds the function get_featuredvideodata() and find the below query

and replace with the below query

documenting to blog post from original source

[Snippet] WordPress: Hide Post By Author From Admin Post List

There is a situation where we need to hide a post written by user A from user B while both of them has same role as “Editor”.

Let’s say we have two user as follow:

UserA with ID 17 and roles Editor
UserB with ID 9 and roles Editor

We need to hide all post by UserB so UserA cannot see it in WordPress Post List (admin page).

Code snippet below may help you to do this in easily.

Modified as you want 😀

[Snippet] WordPress: How to use add_meta_box

The add_meta_box() function was introduced in Version 2.5. It allows plugin developers to add meta boxes to the administrative interface.

For example, you want to add a new field for Post such as City. User need to choose City for the post before publish it. We can use add_meta_box to add a new graphical user interface for meta box.

WordPress-Crunchify-Tag-Cloud

You may add this code snippet in your current active theme functions.php file or create a custom plugin.

Modify the code snippet above as what you need.

 

[Snippet] WordPress: Display Random Post Every Day

Today I got a task from my project manager to display one random post for every day.  I need to create a custom WordPresss plugin to show one random post from custom post type.

The tricky part is that the random post should refresh or re-generate every midnight. So we will see different post everyday.

Example of case: Display word of the day Continue reading [Snippet] WordPress: Display Random Post Every Day

WordPress Plugin – Paparkan Entri Berkaitan

Entri berkaitan yang dipaparkan pada WordPress adalah penting untuk mengekalkan pembaca blog untuk terus kekal berada dan membaca blog anda. Hal ini penting untuk meningkatkan prestasi pelawat dan pembaca blog anda.

WordPress Related Posts by Zemanta

Selain daripada tajuk & isi kandungan entri yang menarik dan unik, paparan entri juga memainkan peranan dalam meningkatkan pelawat entri blog. Terdapat dua cara untuk memaparkan entri berkaitan. Sama ada menggunakan pengaturcaraan PHP + WordPress API atau Plugin sedia ada. Continue reading WordPress Plugin – Paparkan Entri Berkaitan