Hello friends

Magento inline translation can be enabled at System > Configuration > Developer > Inline Translation in Magento Backend:

Please check image below




 Please also make sure to disable Translation and Block output caches at System > Cache Management:

Please check image below



Let me know your comment
Hello friends

If you want to get table then just use below code

$prefix = Mage::getConfig()->getTablePrefix();
echo $prefix;

Let me know your comment
When writing database queries in modules for Magento it is often helpful to wrap the table names in a core function called “getTableName” this function will then prefix the table name if the install is using prefixes in the database.

$table = "catalog_product_entity_int"; // use your own table name $tableName = Mage::getSingleton("core/resource")->getTableName($table); // if a table prefix is defined than it will be added with the table name

Let me know your comment
The code below does as the title suggests. If anyone has been trying to remove the Magento database for whatever reason you’ll find that with all of the key constraints that come with Magento droping every table at once requires a special bit of code.

Below is from a 1.7.0.2 store, different version of Magento may have slightly different tables and custom modules for Magento will also sometimes add their own tables. But in general the code below should work for most and with one execution drop every table in the db.

SET foreign_key_checks = 0;
DROP TABLE `adminnotification_inbox`, `admin_assert`, `admin_role`, `admin_rule`, `admin_user`, `api2_acl_attribute`, `api2_acl_role`, `api2_acl_rule`, `api2_acl_user`, `api_assert`, `api_role`, `api_rule`, `api_session`, `api_user`, `captcha_log`, `cataloginventory_stock`, `cataloginventory_stock_item`, `cataloginventory_stock_status`, `cataloginventory_stock_status_idx`, `cataloginventory_stock_status_tmp`, `catalogrule`, `catalogrule_affected_product`, `catalogrule_customer_group`, `catalogrule_group_website`, `catalogrule_product`, `catalogrule_product_price`, `catalogrule_website`, `catalogsearch_fulltext`, `catalogsearch_query`, `catalogsearch_result`, `catalog_category_anc_categs_index_idx`, `catalog_category_anc_categs_index_tmp`, `catalog_category_anc_products_index_idx`, `catalog_category_anc_products_index_tmp`, `catalog_category_entity`, `catalog_category_entity_datetime`, `catalog_category_entity_decimal`, `catalog_category_entity_int`, `catalog_category_entity_text`, `catalog_category_entity_varchar`, `catalog_category_product`, `catalog_category_product_index`, `catalog_category_product_index_enbl_idx`, `catalog_category_product_index_enbl_tmp`, `catalog_category_product_index_idx`, `catalog_category_product_index_tmp`, `catalog_compare_item`, `catalog_eav_attribute`, `catalog_product_bundle_option`, `catalog_product_bundle_option_value`, `catalog_product_bundle_price_index`, `catalog_product_bundle_selection`, `catalog_product_bundle_selection_price`, `catalog_product_bundle_stock_index`, `catalog_product_enabled_index`, `catalog_product_entity`, `catalog_product_entity_datetime`, `catalog_product_entity_decimal`, `catalog_product_entity_gallery`, `catalog_product_entity_group_price`, `catalog_product_entity_int`, `catalog_product_entity_media_gallery`, `catalog_product_entity_media_gallery_value`, `catalog_product_entity_text`, `catalog_product_entity_tier_price`, `catalog_product_entity_varchar`, `catalog_product_index_eav`, `catalog_product_index_eav_decimal`, `catalog_product_index_eav_decimal_idx`, `catalog_product_index_eav_decimal_tmp`, `catalog_product_index_eav_idx`, `catalog_product_index_eav_tmp`, `catalog_product_index_group_price`, `catalog_product_index_price`, `catalog_product_index_price_bundle_idx`, `catalog_product_index_price_bundle_opt_idx`, `catalog_product_index_price_bundle_opt_tmp`, `catalog_product_index_price_bundle_sel_idx`, `catalog_product_index_price_bundle_sel_tmp`, `catalog_product_index_price_bundle_tmp`, `catalog_product_index_price_cfg_opt_agr_idx`, `catalog_product_index_price_cfg_opt_agr_tmp`, `catalog_product_index_price_cfg_opt_idx`, `catalog_product_index_price_cfg_opt_tmp`, `catalog_product_index_price_downlod_idx`, `catalog_product_index_price_downlod_tmp`, `catalog_product_index_price_final_idx`, `catalog_product_index_price_final_tmp`, `catalog_product_index_price_idx`, `catalog_product_index_price_opt_agr_idx`, `catalog_product_index_price_opt_agr_tmp`, `catalog_product_index_price_opt_idx`, `catalog_product_index_price_opt_tmp`, `catalog_product_index_price_tmp`, `catalog_product_index_tier_price`, `catalog_product_index_website`, `catalog_product_link`, `catalog_product_link_attribute`, `catalog_product_link_attribute_decimal`, `catalog_product_link_attribute_int`, `catalog_product_link_attribute_varchar`, `catalog_product_link_type`, `catalog_product_option`, `catalog_product_option_price`, `catalog_product_option_title`, `catalog_product_option_type_price`, `catalog_product_option_type_title`, `catalog_product_option_type_value`, `catalog_product_relation`, `catalog_product_super_attribute`, `catalog_product_super_attribute_label`, `catalog_product_super_attribute_pricing`, `catalog_product_super_link`, `catalog_product_website`, `checkout_agreement`, `checkout_agreement_store`, `cms_block`, `cms_block_store`, `cms_page`, `cms_page_store`, `core_cache`, `core_cache_option`, `core_cache_tag`, `core_config_data`, `core_email_template`, `core_flag`, `core_layout_link`, `core_layout_update`, `core_resource`, `core_session`, `core_store`, `core_store_group`, `core_translate`, `core_url_rewrite`, `core_variable`, `core_variable_value`, `core_website`, `coupon_aggregated`, `coupon_aggregated_order`, `coupon_aggregated_updated`, `cron_schedule`, `customer_address_entity`, `customer_address_entity_datetime`, `customer_address_entity_decimal`, `customer_address_entity_int`, `customer_address_entity_text`, `customer_address_entity_varchar`, `customer_eav_attribute`, `customer_eav_attribute_website`, `customer_entity`, `customer_entity_datetime`, `customer_entity_decimal`, `customer_entity_int`, `customer_entity_text`, `customer_entity_varchar`, `customer_form_attribute`, `customer_group`, `dataflow_batch`, `dataflow_batch_export`, `dataflow_batch_import`, `dataflow_import_data`, `dataflow_profile`, `dataflow_profile_history`, `dataflow_session`, `design_change`, `directory_country`, `directory_country_format`, `directory_country_region`, `directory_country_region_name`, `directory_currency_rate`, `downloadable_link`, `downloadable_link_price`, `downloadable_link_purchased`, `downloadable_link_purchased_item`, `downloadable_link_title`, `downloadable_sample`, `downloadable_sample_title`, `eav_attribute`, `eav_attribute_group`, `eav_attribute_label`, `eav_attribute_option`, `eav_attribute_option_value`, `eav_attribute_set`, `eav_entity`, `eav_entity_attribute`, `eav_entity_datetime`, `eav_entity_decimal`, `eav_entity_int`, `eav_entity_store`, `eav_entity_text`, `eav_entity_type`, `eav_entity_varchar`, `eav_form_element`, `eav_form_fieldset`, `eav_form_fieldset_label`, `eav_form_type`, `eav_form_type_entity`, `gift_message`, `googlecheckout_notification`, `importexport_importdata`, `index_event`, `index_process`, `index_process_event`, `log_customer`, `log_quote`, `log_summary`, `log_summary_type`, `log_url`, `log_url_info`, `log_visitor`, `log_visitor_info`, `log_visitor_online`, `newsletter_problem`, `newsletter_queue`, `newsletter_queue_link`, `newsletter_queue_store_link`, `newsletter_subscriber`, `newsletter_template`, `oauth_consumer`, `oauth_nonce`, `oauth_token`, `paypal_cert`, `paypal_payment_transaction`, `paypal_settlement_report`, `paypal_settlement_report_row`, `persistent_session`, `poll`, `poll_answer`, `poll_store`, `poll_vote`, `product_alert_price`, `product_alert_stock`, `rating`, `rating_entity`, `rating_option`, `rating_option_vote`, `rating_option_vote_aggregated`, `rating_store`, `rating_title`, `report_compared_product_index`, `report_event`, `report_event_types`, `report_viewed_product_aggregated_daily`, `report_viewed_product_aggregated_monthly`, `report_viewed_product_aggregated_yearly`, `report_viewed_product_index`, `review`, `review_detail`, `review_entity`, `review_entity_summary`,`review_status`, `review_store`, `salesrule`, `salesrule_coupon`, `salesrule_coupon_usage`, `salesrule_customer`, `salesrule_customer_group`, `salesrule_label`, `salesrule_product_attribute`, `salesrule_website`, `sales_bestsellers_aggregated_daily`, `sales_bestsellers_aggregated_monthly`, `sales_bestsellers_aggregated_yearly`, `sales_billing_agreement`, `sales_billing_agreement_order`, `sales_flat_creditmemo`, `sales_flat_creditmemo_comment`, `sales_flat_creditmemo_grid`, `sales_flat_creditmemo_item`, `sales_flat_invoice`, `sales_flat_invoice_comment`, `sales_flat_invoice_grid`, `sales_flat_invoice_item`, `sales_flat_order`, `sales_flat_order_address`, `sales_flat_order_grid`, `sales_flat_order_item`, `sales_flat_order_payment`, `sales_flat_order_status_history`, `sales_flat_quote`, `sales_flat_quote_address`, `sales_flat_quote_address_item`, `sales_flat_quote_item`, `sales_flat_quote_item_option`, `sales_flat_quote_payment`, `sales_flat_quote_shipping_rate`, `sales_flat_shipment`, `sales_flat_shipment_comment`, `sales_flat_shipment_grid`, `sales_flat_shipment_item`, `sales_flat_shipment_track`, `sales_invoiced_aggregated`, `sales_invoiced_aggregated_order`, `sales_order_aggregated_created`, `sales_order_aggregated_updated`, `sales_order_status`, `sales_order_status_label`, `sales_order_status_state`, `sales_order_tax`, `sales_order_tax_item`, `sales_payment_transaction`, `sales_recurring_profile`, `sales_recurring_profile_order`, `sales_refunded_aggregated`, `sales_refunded_aggregated_order`, `sales_shipping_aggregated`, `sales_shipping_aggregated_order`, `sendfriend_log`, `shipping_tablerate`, `sitemap`, `tag`, `tag_properties`, `tag_relation`, `tag_summary`, `tax_calculation`, `tax_calculation_rate`, `tax_calculation_rate_title`, `tax_calculation_rule`, `tax_class`, `tax_order_aggregated_created`, `tax_order_aggregated_updated`, `weee_discount`, `weee_tax`, `widget`, `widget_instance`, `widget_instance_page`, `widget_instance_page_layout`, `wishlist`, `wishlist_item`, `wishlist_item_option`, `xmlconnect_application`, `xmlconnect_config_data`, `xmlconnect_history`, `xmlconnect_notification_template`, `xmlconnect_queue`;
SET foreign_key_checks = 1;

The most important code in the snippet above is the:

SET foreign_key_checks = 0;

and

SET foreign_key_checks = 1;

These snippets of code disable the key checks and allow the query to execute as intended.
Joining tables in Magento when it comes to EAV with Flat table is quite complicated. Consider you want to join sales_flat_order table with customer EAV tables to get Customer’s firstname and lastname, it becomes difficult as customer’s name comes from customer_entity_varchar table.

Below code will join sales order flat table with customer EAV to get customer’s full name in the collection along with all the order details.

$coll = Mage::getModel('sales/order')->getCollection();
$fn = Mage::getModel('eav/entity_attribute')->loadByCode('1', 'firstname');
$ln = Mage::getModel('eav/entity_attribute')->loadByCode('1', 'lastname');
$coll->getSelect()
    ->join(array('ce1' => 'customer_entity_varchar'), 'ce1.entity_id=main_table.customer_id', array('firstname' => 'value'))
    ->where('ce1.attribute_id='.$fn->getAttributeId())
    ->join(array('ce2' => 'customer_entity_varchar'), 'ce2.entity_id=main_table.customer_id', array('lastname' => 'value'))
    ->where('ce2.attribute_id='.$ln->getAttributeId())
    ->columns(new Zend_Db_Expr("CONCAT(`ce1`.`value`, ' ',`ce2`.`value`) AS fullname"));
print_r($coll->getData());

Let me know your comment if you have any query
While many blaim Magento for being slow, it is possible to make the Magento e-commerce application lightning fast. This requires first of all funding, because you will need to add sufficient system resources (CPU, memory) to Magento to make it run properly. But it also requires time and knowledge. For the last part – knowledge – this list helps you further.

Enable Magento caching

This is ofcourse the first step in optimization: Enable all the available caches in the Magento Admin Panel.
Compress images

Many people forget that images (PNG, JPG) can be compressed, which lowers the bandwidth between the browser and the webserver. Not only the images used by the Magento skin need optimizing, but catalog images as well. Various tools allow you to compress batches of images, for instance the online tool Smush.It.


Disable unneeded Magento modules

By disabling Magento modules that you do not need, less resources are needed – as simple as that. Modules could be disabled through the configuration in the Magento Admin Panel, or by editing XML-files in app/etc/modules. For instance, disable Mage_Log which performs queries on every request, but is not needed if you gather site statistics using external programs.


Enable flat catalogs for smaller webshops

For smaller webshops switching from the complex EAV-structure to a flat catalog could save time. This optimization is dubious and depends on many parameters, so do not take this step lightly.


W3C compliance

While it could be argued that this is less important with the coming of HTML5, it is still a fact that if your webpages are filled with ugly errors, the browser will have a harder time interpreting it. If you stick to W3C compliance, it is made sure the browser engine has an easy job parsing your HTML-code.
Compress output in general

By enabling the PHP-setting zlib.output_compression the output generated by PHP is compressed when sent to the browser. This saves bandwidth. Instead of using this, you could use the Apache mod_deflate module as well, which allows also for compression of non-PHP output (CSS, JavaScript, other plain text-files).


Configure PHP options

Most PHP settings actually do not influence the performance of Magento, but just set certain limits. For instance, settings like memory_limit and max_execution_time do not increase the page load but just make sure that certain actions do not timeout or run into memory problems.


Session storage

With Magento, sessions could be stored in files or in the database (by configuring app/etc/local.xml). Which option performs best, really depends on how the hosting environment is setup. If MySQL databases perform well, session storage in the database could benefit your site. But if MySQL is not setup correctly, the best choice might be files.


Use a PHP accelerator

By opcode caching, PHP-execution could be fastened. There are various PHP accelerators doing this job (APC, ZendOptimizer+, eAccelerator, XCache). Both APC and ZendOptimizer+ are working flawless with Magento.


Tune PHP realpath_cache

By tuning the PHP realpath_cache_size to for instance 128K (default is 16K) and the realpath_cache_ttl to 86400, things might be speeding up. Make sure you don’t run out of memory, because every Apache child will consume the configured caching size.


Use Apache mod_expires

By telling the browser which files to keep in cache for how long, you can optimize the browser cache. For instance, JavaScript files tend to change much less then CSS files (at least in the first stages of the site), but perhaps after the site is running smooth for some months you can maximize the expiration date.


Beware 404 errors

Every time a file (like a stylesheet or image) is not found, this generates a 404 error. Because the default 404 of Magento is caught by the application of Magento itself, this causes the Magento application to start for every 404 encountered. Check your Apache logs to make sure all 404 errors are solved.


Disable Magento logging

Within the Magento configuration, you can enable logging under the Developers-tab. Depending on the Magento modules this could lead to more logs needed to be written to the filesystem, slowing down your shop. Because the logging-abilities are only needed to debug something, in daily usage, it’s best to disable logging altogether.


MySQL table optimization

Through phpMyAdmin, you can perform the command OPTIMIZE TABLE on specific Magento database-tables. When a table is cluttered, this could lead to improved performance. This does not only count for the complex EAV-tables, but also for regular MySQL tables that are used frequently (for instance, core_config_data).


Merge CSS and JavaScript

By merging all CSS and JavaScript files together as one big file, only one single HTTP-request is needed by the browser to fetch this content. This saves bandwidth. For this merging, the FooMan Speedster module could be used. Magento 1.4 contains an option to merge CSS, while JavaScript-files are merged by default.

Besides merging, crunching is also an option offered by FooMan Speedster: It removes whitespaces from the output, but when compression is already applied to CSS, this option is less needed.


Use Magento Compiler module

The Magento Compiler module limits the number of directories that PHP has to search through when looking for PHP-files. This decreases the PHP execution-time, which speeds up the Magento application in general.

Be warned that you need to be careful when making changes to your Magento system, while the Magento Compiler is enabled. Upgrades should only be undertaken when the compiler is (temporarily) disabled.

One very neat trick that speeds up things tremenduously is to create a tmpfs-mount specifically for the includes/src folder. Note that this tmpfs-mount needs to be at least 100Mb – preferably 200Mb.


MySQL server tuning

The default MySQL setup is a lot of times sufficient to run a general hosting environment, but not all optimized for Magento. Tuning settings like query_cache_size could dramatically increase performance, but is also dangerous because it hugely depends on other variables (number of databases, number of tables per database, number of queries, peak usage).


Serve static content through a CDN

Static content like images, CSS-stylesheets or JavaScript-files, could be served through other servers that are more optimized for static content. For instance, a CDN could be used so that the static content is always served from a location that is closest to the visitor. This is vital for webshops serving customers worldwide.


Disable local Magento modules

If your site does not need local Magento modules, you could choose to skip the search for local modules alltogether. Within the app/etc/local.xml file, you will find an XML-tag allowing you to do so.


Be carefull with HTTPS

Every time you use SSL between webserver and browser, the process of encrypting and decrypting is added on both sides. Also there is a slight overhead in bandwidth. The Magento site runs slightly faster if you disable SSL for all or just a few pages. However, this “win” is so small compared to the other wins on this page, that it should only be handled with caution. The gained bandwidth is non-vital, while almost all computers nowadays have CPU-power with which the encryption/decryption process takes place in microseconds.

Magento in the cloud

While CDNs could be used to optimize the bandwidth for static content, the Magento application could also be optimized in the same way by using cloud computing.

Memory-based filesystem for dynamic data

By storing dynamic data (var/cache, var/session) on a memory-based filesystem like RAMdisk or tmpfs, the disk I/O is decreased.

Disable Apache htaccess-files

When allowing the usage of htaccess-files, Apache needs to inspect every directory in its path to see if an htaccess-file is present. By moving the Apache configuration-directives from the htaccess-file to the VirtualHost configuration-file, and disabling htaccess-files all together, the Apache execution-time is decreased. This tip probably applies in most cases only to dedicated servers.

Use Nginx or Litespeed

While the Apache webserver is very flexible in its configurations, there are other webservers that are better optimized regarding memory usage: By replacing Apache with either Nginx or Litespeed, you could speed up the Magento scripts even more. Both webservers require manual configuration to allow for SEF URLs.

Use lazyload for images

When a page is loading, a visitor is often waiting for images on that page to load. Depending on the number and size of these images, this can take some time. Instead of loading images at once when the page is loaded, you can also add the LazyLoad JavaScript effect that makes sure only visible images (within the browser screen) are loaded, while remaining images are only loaded once the visitor scrolls down.

Minimize Apache logging

If Apache logging is minimized, less file operations are needed for every incoming request. Ofcourse less logging also means less insight when something goes wrong. An alternative is to optimize the filesystem on which Apache logs are stored. By default, Apache logs to the /var filesystem – but there’s no need to enable things like journalling for that filesystem.
I had a client come up to me which a strange magento situation.  The template or extensions they installed seamed to have broken the coupon code submit button on their cart page.  People could not submit a coupon code by clicking the “Apply Coupon” button.  They had to hit enter.  The clients could not find the javascript that was producing the error.  So, I was contacted to provide them with a magneto workaround.  The solution is quite simple.
Find the pesky code:
1
<button type="button" title="Apply Coupon"onclick="discountForm.submit(false)" value="Apply Coupon"><span><span>Apply Coupon</span></span></button>
and change it to:
1
<button title="Apply Coupon" onclick="discountForm.submit(false)"value="Apply Coupon"><span><span>Apply Coupon</span></span></button>
By removing type=”button” the error seems to correct itself.  After removing the type, the button magically started working again!  I know this treating the symptom not the problem, but hey it works.
We've fixed this Magento/PayPal issue for quite a few clients when they were told the same thing by PayPal support. 

In Magento Community 1.7.0.2 you need to copy the file: 
/app/code/core/Mage/Paypal/Model/Api/standard.php 

to: 
/app/code/local/Mage/Paypal/Model/Api/standard.php 

and change line 238 from: 
$request['address_override'] = 1; 

to: 
$request['address_override'] = 0; 

Once you do the issue goes away and you won't experience the issue with orders anymore. It would be nice if this could be a config choice in future versions of magento, or change to paypal's recommended setting by default. 

Some of our Magento clients receive the same error as your clients were on up to 1/3rd of their PayPal based orders. 
How to get product images on magento product page separately

<?$_images = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();?>
<?if($_images){?>   
   <?$i=0; foreach($_images as $_image){ $i++;?>
      <a href="#"><img src="<?=$this->helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(200, 130); ?>" width="200" height="130" alt="<?=$this->htmlEscape($_image->getLabel());?>" title="<?=$this->htmlEscape($_image->getLabel());?>" /></a>    
   <?}?>
<?}?>

There is a great deal of frameworks, PHP ones in particular, fighting for developers attention. Zfort Group is an interested party in terms of choosing the best PHP frameworks for our custom PHP projects and internal ones as well. So we are continually investigating trends, developers’ voting, forums, reviews, ratings, etc. We collected unique and very interesting information and it could be really helpful to the PHP community.
So the following infographical analysis of top 5 PHP frameworks is at your disposal:

Responsive design is an important feature of a good website.  The ability of your site to adjust to different screen sizes and still look good is something that visitors remember.  If you are using a good WordPress theme and framework, responsiveness is often built into the design.  Even then, you might run into a few issues.
How To: Responsive Header Image for Genesis Framework - Before
ScanThisGuide.com before any changes (besides changing the header image size)
I just launched a site, ScanThisGuide.com, using theFocus child theme built on the Genesis framework.  Everything was going well with the design until I checked it on my iPhone.  The site looked great except for the header.  After a little digging around on Google, it seems that other users are having similar problem.  After a little more digging, I found several possible solutions, including a plugin and some extensive code changes, but one that stood out to me because it was simple.
(The Focus child theme and the Genesis framework are both great products I personally use.  If you buy using these links, I get a small commission.  Not much, but it doesn’t cost you anything extra and I can go buy a cup of coffee.)
A special thanks to Antonios007 from GitHub where I learned of the CSS changes  that needed to make for the header image to be more responsive.

Resize the header image

During the site design, the header image that I wanted to use was much smaller than what the Focus child theme was setup to handle.  To add a custom header image to the Focus child theme, you go to Appearance->Header under the WordPress admin dashboard.  Once there, you can upload and crop your header image.  The problem I ran into was the size and aspect ratio it wanted.
Apparently, there is no way to upload an image that is not 1060px wide and 120px without cropping and re-sizing.  My image is 390px wide and 130px tall.  After a little Google research and experimentation, I found the place where the Focus child theme added a custom header to the Genesis framework (in functions.php):
/** Add support for custom header */
add_theme_support( 'genesis-custom-header', array( 'width' => 1060, 'height' => 120 ) );
As you can see, the width and height are both specified.  Here’s a screenshot of  what it looked like originally when uploading a custom header:
responsive-header-image-genesis-admin-orig-header-size
Notice that the header image needs to be 1060px by 120px to be used as-is.  If you upload an image of a different size, you must crop it using the same proportions. Since my image was 390px by 130px, I changed the specified width and height in the functions.php file.  Here is what it looks like now:
/** Add support for custom header */
add_theme_support( 'genesis-custom-header', array( 'width' => 390, 'height' => 130 ) );
A simple but important change.  Let’s see what it looks like when adding a custom header after the change:
responsive-header-image-genesis-admin-modified-header-size
How To: Responsive Header Image for Genesis Framework - After changes with a wide header image
ScanThisGuide.com after making the header responsive but without a custom header size
As you can see, the dimensions of the required image is the same size as my header image.  Once uploaded, the header image will be displayed properly.
This step is important to the responsive header image but I had no idea until I started tweaking.  If the header image is kept the full 1060px wide, the result is like the image to the right.  Since the logo is small, the most interesting part of the header image is hard to see.  This detail was not obvious until the changes below were made.

Editing the CSS code for small screen sizes

The CSS code controls almost everything about the design of your website, including the colors, positions, and even how it is displayed on certain devices.  Looking at the style.css for the Focus child theme, you will see the code that controls the responsiveness of small screens.  Near the bottom of the file you will see this line of code:
@media only screen and (max-width: 600px) {
Anything under this declaration block will modify what happens when a small screen views your site.  This section is the one that controls the formatting when your site is viewed on an iPhone or other small screen.  Looking at the file provided by Antonios007 from GitHub, the following lines of code need to be added under this declaration block:
#header {
     background-size: contain !important;
     height: 110px; /* original: min-height: 100%; */
     overflow-y:hidden;
}
Notice that part of the second line changed.  The original code snippet from Antonis007 set a minimum height of 100%.  In effect, this set the height of the header to 100% of the height the header image.  Unfortunately, my header image was too wide, resulting in the screenshot at the top of the page.  The height was specified to be 110px, a value that was determined through trial and error once the header image was responsive.

Editing the CSS code for the Image Header – Partial Width

The last piece of the puzzle was a small change in the main body of the styles.css file.  It can be quickly found by doing a search in the browser.  The code that needed to be changed is as follows (colored red):
/* Image Header - Partial Width
------------------------------------------------------------ */

.header-image #title-area,
.header-image #title,
.header-image #title a {
     display: block;
     float: left;
     height: 100%; /* height: 120px; */
     overflow: hidden;
     padding: 0;
     text-indent: -9999px;
     width: 400px;
}
Instead of specifying the height to a specific size (the commented property), you need to change it to 100%.
Once these changes were made, the header image is now responsive.  Take a look:
How To: Responsive Header Image for Genesis Framework - Final
ScanThisGuide.com after all changes
Notice that the logo fills the width of the screen.  At this point, it would be fairly easy to tweak the size and placement of the header image for small screens.  Be sure to check your page on different devices to make sure it looks right.  For this site, anything larger than an iPhone turned out fine since the width of the header image was less than the width of the screen.
Congratulations, if you are using the Focus child theme or a similar theme, you should be able to modify your code enough to have your very own responsive header image.  If you are looking for a great responsive theme, be sure to check out theGenesis framework.  Remember, having a responsive web site is an important part of the user experience.  Having a consistent look to your site across multiple devices will help visitors identify with your brand and have a better experience.  Good luck.

After a great deal of frustration and numerous tantrums I discovered the solution is to wrap the code in a loop that checks if it’s a category page.
//LOOP TO CHECK IF ITS A CATEGORY PAGE
<?php if (Mage::registry('current_category')) { ?>


//INNER LOOP

<?php if(Mage::registry('current_category')->getId() == 5):?>
   <p>Shows this paragraph is the category id="5"</p>
<?php else: ?>
   <p>Else show this for different category pages</p>>
<?php endif; ?>

//SHOW THIS CONTENT IF ITS A CMS PAGE
<?php } else { ?>
   <p>Else show this paragraph for all other pages</p>>
<?php } ?>

One thing we will meet for sure in magento is the category. One of the task we will need to do is the listing of child categories, the subcategories. In the following example will be listed the subcategories of a category given by it’s ID.
    <ol>
    <?php
    $parent_category = Mage::getModel('catalog/category')->load(15);
    $subcategories = $parent_category->getChildrenCategories();
    foreach ($subcategories as $child)
    {
     echo "<li><a href=\"".$child->getUrl()."\">" . $child->getName();
     echo   "</a>(".$child->getProductCount().")";
     echo "</li>";
    }
 
    ?>
    </ol>
You can check out the following working example for category subcategories.

This is Magento default feature. In top.link you can find login or logout link.But if you want to put somewhere login/logout button then you need to check whether a user logged in or not by the code given below.

<?php
if ($this->helper('customer')->isLoggedIn() ) 
{ 
echo '<a href="<?php echo $this->getUrl('customer/account/login/');?>">Login</a>';
} 
else
{
echo '<a href="<?php echo $this->getUrl('customer/account/logout/');?>">Logout</a>'; 
} 

?>
In this example we will add a “payments” block / image to the left column of the magento page. For e.g. a Paypal GIF showing customers the payment methods available.
When adding content to the left or right column of the Magento template you need to firstly create a static block:
1
Admin -> CMS -> Static Blocks
Fill out the required content – keep note of the single worded indentifier
E.g.
1
payment_box
Enable to static block and add the content you wish:
1
2
3
4
5
6
<div class="sideBox">
    <div class="title">Pay with Paypal!</div>
    <div class="content">
        <img src="{{skin url=""}}images/paypal.gif" alt="Pay with paypal" />
    </div>
</div>
Note:
Don’t forget to choose the store views you wish to enable this static block for.
Now, in order to display the static block, open your CMS page you wish to insert the block into.
1
Admin -> CMS -> Pages -> YOUR_CMS_PAGE -> (left side) Design
Under the design section of your CMS page, chose a layout with column – for example “2 columns with left bar” and under the Layout Update XML section is where you want to enter your static block reference.
1
2
3
4
5
<reference name="left">
    <block type="cms/block">
        <action method="setBlockId"><block_id>payment_box</block_id></action> 
    </block>
</reference>
That’s it :) Save and refresh your website!