WordPress Turn Off Auto Update for Single Plugin

Wordpress Turn Off Auto Update for Single Plugin

WordPress Turn Off Auto Update for Single Plugin

While working with plugins sometimes we need to change the default values and attributes of the plugin which may be lost as soon as the plugin creator add the update to wordpress.
For to disable the auto update or hiide update message from the admin we can add the follwing line in finction.php .

function filter_plugin_updates( $value ) {    
unset( $value->response['plugin-directory-name/plugin-file.php'] );    
return $value;
add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );

Here plugin-directory-name is the plugin folder name you want to disable and plugin-file.php is the main file of the plugin.

Source : http://wordpress.stackexchange.com/questions/25358/turn-off-auto-update-for-single-plugin

Create a pop-up WordPress email contact form 7

Contact form 7 can be used for different kinds of forms. Sometimes we may need to show the form in popup display. For to show the contact form in popup we can simply install Easy fancybox  and Contact Form 7 from wordpress plugin directoy and simple configure as below,
Firstly create contact form as you required and place contact form shortcode as below

<a href="#contact_form_pop" class="fancybox">Contact Us</a>

<div style="display:none" class="fancybox-hidden">
    <div id="contact_form_pop">
        [contact-form-7 404 "Not Found"]

For further detail you may visit to url below,

Source : http://geektastical.com/2011/05/how-to-create-a-pop-up-wordpress-email-contact-form/

Magento quantity increments using jQuery

If we need to add increments in the quantity then we can follow the below simple method .
First of all we need to add the jQuery code. Add the following to one of your jQuery js files (or create a new one if that’s your thing).

jQuery("div.quantity").append('<input type="button" value="+" id="add1" class="plus" />').prepend('<input type="button" value="-" id="minus1" class="minus" />');
            var currentVal = parseInt(jQuery(this).prev(".qty").val());
            if (!currentVal || currentVal=="" || currentVal == "NaN") currentVal = 0;
            jQuery(this).prev(".qty").val(currentVal + 1);
            var currentVal = parseInt(jQuery(this).next(".qty").val());
            if (currentVal == "NaN") currentVal = 0;
            if (currentVal > 0)
                jQuery(this).next(".qty").val(currentVal - 1);

Then Move the file app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml into your theme directory if you haven’t already, open it up and look for line 34. You should see the code for the input which will look something like:

<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />

Change the AS BELOW

<div class="quantity">
<input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
Source : http://jigowatt.co.uk/blog/magento-quantity-increments-jquery-edition/

Eclipse – “Too many open files” Problem

If your OS is Linux and you are using Eclipse, you might possibly see the following error messages or similar on certain time. This may result by installing many plugin or other reasons.
This is because there are too many files opened and these are more files than the number of open files allowed . So Eclipse cannot open more files and displays the errors above.
Let’s see the number of open files.
$ lsof | wc -l


$ lsof | wc -l

In my case, it was 9028.

Now check the limitation of open files

Now check the limitation of open files
$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 31226
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 31226
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

To change it, open the file /etc/security/limits.conf and put a greater number than 1024 depending on the number of open files you checked with lsof | wc -l just before.
For example,
Open the file
$ gksudo gedit /etc/security/limits.conf
add these lines
*                soft    nofile          9216

*                hard    nofile          9216

Log out and in then check with ulimit. It should show like this.
For more detail view in below page,

Source: http://blog.lckymn.com/2009/08/11/eclipse-too-many-open-files-problem/comment-page-1/

Customize WordPress login logo without a plugin

Sometime wordpress developer need to change the wordpress logo in admin login screen while creating the site for the client. For that we can simply include the code below and deploy it without using any plugin. Simply copy and paste the code below in the function.php of your theme folder.

function my_custom_login_logo() {
    echo '<style type="text/css">
        h1 a { background-image:url('.get_bloginfo('template_directory').'/images/custom-login-logo.gif) !important; }

add_action('login_head', 'my_custom_login_logo');

The image that need to changed should be placed in the images folder of the theme.

Source: http://www.wprecipes.com/customize-wordpress-login-logo-without-a-plugin

Magento – Display Address Fields on Create an Account

By default Magento doesnt show the address fields within “Create an Account”. To make the sign up process more user friendly you can enable the address fields by adding the following:
Simple way to show that is to add the below code in customer.xml or in local.xml

        <reference name="customer_form_register">
            <action method="setShowAddressFields"><value>true</value></action>
Source : http://www.pauldonnelly.net/magento-display-address-fields-in-create-an-account/ 

Customer cannot login to magento

Using the free theme sometime may result  of customer not logged in problem issue. To resolve this issue we need to put the for key field in the login form.
In app/design/frontend/default/…/template/persistent/customer/form/login.phtml , around line 41 should look like

 <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="login-form">
 <?php echo $this->getBlockHtml('formkey'); ?> 

If the code is not seen then add it then customer login works

Category Specific Single Post Templates

Sometimes we may required different category related single post template , i get the following things .
First put the code in function.php

// set up category specific single.php templates
add_filter('single_template', create_function('$t', 'foreach( (array) get_the_category() as $cat ) { if ( file_exists(TEMPLATEPATH . "/single-{$cat->slug}.php") ) return TEMPLATEPATH . "/single-{$cat->slug}.php"; } return $t;' ));

Then create file as single-categoryname.php. Now the custom template will load while loading the page related to the categoryname.

“Error 404 Not Found” in Magento Admin Login Page

I got “Error: 404 Not Found” when  transfered my magento installation from one local machine server to another. Now, I cannot login to admin panel and I got “Error: 404 Not Found”

The reason for this error is that store_id and website_id for admin should be set to 0 (zero). But, when you import database to new server, somehow these values are not set to 0.
Open PhpMyAdmin and run the following query in your database:-

UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
Source : http://stackoverflow.com/questions/5178066/error-404-not-found-in-magento-admin-login-page 

Magento no input file specified error in Godaddy Hosting

A common error, which usually comes up if you’re hosted by GoDaddy, is the no input file specified error.
Try this first:
add this to your .htaccess file

RewriteEngine On
RewriteRule ^.+.php$ /bogusfile

Then try to reload your setup page.
If you do not have Magento setup in the root of your server, make sure to add the following to your .htaccess file.

RewriteBase /yourbasepath/

Once that is verified, there are a couple things you can do to fix this, but we’ll start with the one that usually works.
In your web root directory, there should be a file called php.ini. Rename this to php5.ini.
If there is no php5.ini file. Create the file and upload it to your root directory.
If that doesn’t work, add the following to the end of your newly renamed php5.ini file:

cgi.fix_pathinfo = 1

And if you’re still getting the error, add the following to the top of your .htaccess file:

Options -MultiViews

The first one usually does the trick. If you don’t see this file in there, then create a blank php5.ini file add add the line listed on the second suggestion.
If all of the above has not worked, KEEP your changes, wait exactly 24 hours. Go back to youraddress.tld/downloader and try again. You may just be cached and for some reason it takes a bit longer then I was used to. Keep your chin up!
If nothing above worked, call GoDaddy up and have them either rename this for you, or make sure you’re on PHP 5.

Source : http://www.magentocommerce.com/wiki/groups/227/error/no_input_file_specified