Display Recent And Random Image On Wordpress

Hello all^^
I never tried to make experiment and today I have little experiment to display recent image of nextgen gallery on Wordpress home page. First you must have execphp plugin installed on your Wordpress blog. You can download here. Exephp plugin is used to enable execute php on Wordpress page. So you can execute php on your Wordpress page, but be careful with WSIWYG. WSIWYG will filter all php code. so you must use HTML editor to create your home page.

After you have plugin installed, change default wordpress post page to another page. For example blog. Then you must create new page for home page. Go to Setting->reading->front page displays and change it to A static page (select below). Select your front page to home and your post page on blog.

Then install nextgen image gallery. I had post about it on previous post.

This is the important step to display recent image on wordpress.
Open nextgen-gallery directory and find “nggwidget.php”. In this file contain nggDisplayRecentImages function that you can use to display recent image on home page. Copy all script on this file without “<? php ?>” to your function.php on your active theme (design->theme editor->your active theme->function.php). Warning: do not change default script on your function.php, just add this script bellow.

Finish? Lets modify you home page (Don’t use WSIWYG editor) and use this script to display recent image that you have upload on nextgen gallery.

<?php nggDisplayRecentImages(x,y,z);?>

<?php nggDisplayRandomImages(x,y,z);?>

where x is number of images to display, y = width of thumbnail, z = height of thumb. I had to also change a little nggallery.css (part commented as /* –Sidebar widget–*/ ) to have random images the same style as others and… that’s all.

I use this this to my recent Blog project, just check this out for demo http://alliedbeat.com

It’s very nice and make Wordpress more powerful^^

Have a nice blogging…



Related Post:

One Comment Trackback URL | Comments RSS

  1. CellCreefothe Says:

    Cheers!
    I made on photoshop animated myspace pics.
    have a look at them:
    http://tinyurl.com/65lf75
    Thanks 4 your site ;-) xxoxo

Post a Comment

Your email is never published nor shared. You're allow to say what you want...

Blogroll Link Update
Warning: Unknown: write failed: Disk quota exceeded (122) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0