WordPress Bhaktapur first formal meeting


Yesterday group of WordPress Bhaktapur had the first formal meeting at FnClick. Even though a small number of people attended the meeting, it was fruitful regarding the decision made. All the attendees shared their ideas regarding the new programs.
Following are the summary of the meeting.
– Formally announced WordPress Bhaktapur formation.
– Formed an organizer team for WordPress Bhaktapur.
– Discussion about short term and long term goal.
– Decided upcoming program which will be announced soon in the group.
– And other discussed other minor topics.
WordPress Bhaktapur group will be conducting programs that will directly benefit the people working on WordPress and also helping NGOs through the WordPress.

SCRIPT_DEBUG constant in WordPress

By default WordPress loads minified version of CSS and JS files so that it would contribute in loading time. As from the user point it is helpful but as for the developer point it might be sometime painful during development. Minified CSS and JS files are very hard to read and understand, so debugging becomes complicated in that case.
In such cases it would be very easy if we could see the unminifed versions of CSS and JS, isn’t it?
Yes, it would be very easy and WordPress have solutions for it.
It is SCRIPT_DEBUG constant.
Just put following line as you define constant WP_DEBUG in wp-config.php file.
define( ‘SCRIPT_DEBUG’, true );
After you put this line in wp-config.php and view page source then you can see the unminified version of the CSS and JS.
That’s a great start, but what about its use in plugin or theme?
Definitely there SCRIPT_DEBUG has its use in plugin or theme. Its better to have minified and unminifed version of CSS and JS in our plugin or theme. We can load our minified version of files using following method.

<?php
function your_plugin_scripts() {
	// if SCRIPT_DEBUG is undefined/ false, use minified libraries
	$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
	// Load script.
	wp_enqueue_script( 'plugin-script-handle', plugin_dir_url( __FILE__ ) . 'assets/plugin-script-file' . $suffix . '.js', array( 'jquery' ) );
	// Load style.
	wp_enqueue_style( 'plugin-style-handle', plugin_dir_url( __FILE__ ) . 'assets/css/plugin-style-file' . $suffix . '.css', array() );
}
add_action( 'wp_enqueue_scripts', 'your_plugin_scripts' );

And this would load minified version of you files if SCRIPT_DEBUG is not defined or false.
Hope this small article would be some how helpful to you. Let me know your feedback.

Add JQuery LightBox in WordPress Gallery

Yūjin kon’nichiwa (友人こんにちは) (Hello Friends in Japanese), Today I am going to talk Little about the WordPress Default Gallery and will show you how to get the JQuery Lightbox effect on the WordPress Gallery.
As we all know WordPress Have it’s default Gallery Feature with shortcode. Its a very simple and useful feature given by WordPress. But while using this feature I felt that it would be great if we could add the JQuery lightbox in the Gallery as default gallery links image to its original image or can a be linked to attachment page. For this idea I searched for a useful plugin and I found Pretty Photo Media, that worked perfectly for me. Download and activate the plugin.
This plugin used “rel” attribute. So I used following hook for adding the attribute. Place it in the functions.php of your current theme.

add_filter( 'wp_get_attachment_link', 'theme_prettyadd', 10, 6);
function theme_prettyadd ($content, $id, $size, $permalink, $icon, $text) {
$content = preg_replace("/<a/"," return $content;
}

Now, Insert your gallery in post or page. While inserting gallery one thing you have to check it you need to change Link To In Gallery Settings Option to “Media File”. If you are done with all things then refresh your gallery page and there you are. The gallery is lightbox enabled.
Comment if you have any question or you can also share your view for this post.

Codeigniter remove index.php

Hola Amigos (Hello Friends in Spanish) 🙂 , In this post I am going to show how do we remove index.php in Codeigniter.
While you install fresh Codeigniter your URL is some thing like this:
example.com/index.php/class/function/ID
But this URL structure is not so much charming and is also not much SEO friendly. So we would like to change above URL to something life this:
example.com/class/function/ID
To modify the URL you need to enable mod_rewrite module first, since it’s initially disabled in apache configuration file. Open httpd.conf and search for “mod_rewrite”. If you are a WAMP user like me than to find httpd.conf in your Taskbar click WAMP icon -> Apache->httpd.conf. You will find a line with following text.
#LoadModule rewrite_module modules/mod_rewrite.so #AddModule mod_rewrite.c
Uncomment the lines (remove the trailing #) like this:
LoadModule rewrite_module modules/mod_rewrite.so #AddModule mod_rewrite.c
Than you need to restart the WAMP or whatever server you are using.
Now next step to to create a .htaccess file with following code.

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Now if you remove index.php from you URL then it would perfectly work. In some of the server we will find error showing “No input file specified”. Then we need to just add “?” after index.php and it will solve problem.

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

I hope this small post would help you some how. Happy Coding.
Reference
http://ellislab.com/codeigniter/user-guide/general/urls.html

Parallax Design

This is just a brief research done to gain the knowledge about the Parallax Design and gather the resource to about it. So I have mentioned different site links where I found suitable points. This is not a tutorial and want to help you find the suitable resource about the Parallax Design. Hope it helps.

Parallax…?
Parallax is a displacement or difference in the apparent position of an object viewed along two different lines of sight, and is measured by the angle or semi-angle of inclination between those two lines. (Wikipedia)
And what is Parallax Design?
According to unleashed-technologies.com : Parallax site design is which the background of the website moves at a different speed as the rest of the page for an impressive visual effect that allows for countless creative applications for online storytelling.
(The site also shows trending status, opportunity of use, downside and tips for the parallax design.)
So is Parallax Design a trending subject?
Yes, Google Trends Shows it as a growing trend in the since 2009 and its trending rapidly. Google,Flickr, Puma and other many big and small companies are using this design concept.
What about Compatibility Issues?
According to joshcarllewis.com : If we assume that only those who are using browsers that don’t support or have JavaScript won’t be able to use see any parallax effects, then  according to data from Yahoo that is 2% of average traffic in the US and 1.3% in the UK. While low this number is there and must be kept in mind. If only using the plugins to make some elements more exciting this shouldn’t be a problem as backgrounds will still remain, but sites that make heavy use of jQuery to take the user along a path with popups and animations will suffer badly.
What are requirements for Parallax Design?
According to site: onbile.com : following are the requirements for parallax design:

  • CSS: Containers with relative positions

  • CSS: Using absolute positioning

  • CSS: Using z-index floating objects

  • PNG images with transparent backgrounds

  • Images, using sprites

  • JavaScript to recognize scroll position

How to create a simple parallax effect?
Webdesignerdepot.com Shows the basic example of the parallax design. That simply scrolls the position of the background image with respect to the scroll of the browser content. (Demo)
Themeforest.com uses JQuery to take a horizontally scrolling website and add a parallax scrolling background effect reminiscent of old-school 2D platform games like Sonic the Hedgehog. (Demo)
Webdesignshock.com shows a bit advance way to the parallax design. (Demo)
Is there JQuery Plug-ins for the parallax design?
Yes, there are. Some of them are listed below:

Parallax plugins comparison
The comparison of the parallax plug-ins can be found in Github.com.
Inspirations

WordPress & Parallax Design.
As the WordPress is one of the most popular CMS, application of the parallax design in WordPress is also rapidly growing. Some parallax beautiful themes for WordPress:

Other Resources
Behind The Scenes Of Nike Better World – Smashingmagazine.com
Create a Parallax Scrolling Website Using Stellar.js – Tutsplus.com
Parallaxin’ – Html5rocks.com
Rise of the Parallax Effect – Joshcarllewis.com
Parallax Scrolling and Its Usage in Web Design – Designmodo.com