Join two table in magento

For eg:
I have to add one field for displaying ‘rule_id’, ‘status’, ‘send_date’ field as a columns in customer grid.
//Customer grid collection
$collection = Mage::getResourceModel(‘customer/customer_collection’)

/***From here we can left join with ‘giftcard’ table, join criteria is ‘gf.customer_id = e.entity_id’ and in array we can specifie the ‘rule_id’ as index in column and its values are from table giftcard. i.e ‘gf.rule_id’ and i have grouped with customer primary key i.e ‘e.entity_id’ ***/

‘gf.customer_id = e.entity_id’,
‘rule_id’=> ‘gf.rule_id’,
‘status’ => ‘IF(gf.status IS NULL,”Unsend”,”Send”)’,
‘send_date’ => ‘gf.created_time’
//To add column
Add below

$this->addColumn(‘created_time’, array(
‘header’ => Mage::helper(‘giftcard’)->__(‘Coupon Send Date’),
‘align’ => ‘left’,
‘index’ => ‘send_date’,
‘type’ => ‘datetime’,
‘gmtoffset’ => true

I hope this will help you..


How to Add Page Slug in Body Class in Joomla

$menu = &JSite::getMenu();
$active = $menu->getActive();


Add Alias to Body

Next, let’s print the active menu item’s alias as either an id or class attribute on an html element. In this example, we’re printing it as the id for the document’s body.

<body id="<?php print $active->alias; ?>">

Learn Wordpress of Beginner




WordPress comes with default themes during the initial installation, so it is advisable to refer to these default files before starting, so that you get a decent idea about developing your own theme.

Under this section of the checklist, you will find some of the basic header settings related to the theme name, URI, version, etc, which will need to be in place before you move on to the more technical part.

You will also need to make sure that your stylesheet provides details about the theme in the form of stylesheet headers.

/* Theme Name: The Name of your theme   
* Theme URI: The URL for more information
* Description: Theme Description 
* Version: 1.0 
* Author: Your Name
* Author URI: Your URL  
* Tags: Red, black, widget‐ready etc
* Template: If you are building a child theme*/


The stylesheet is responsible for the visual design and layout of the theme. That is why, it is very important that you pay special attention to the style.css file.

In addition to that, you also need to make sure you maintain the other CSS files in a separate CSS folder.

theme root folder
  • Style.css
/css/ folder
  • Custom.css
  • Print.css
  • Reset.css
  • ie.css
  • Theme Preview Image (screenshot.jpg/screenshot.png/screenshot.gif)
  • Widget Ready Sidebars
  • Add Rules to your Comment form
  • Backwards Compatibility (WordPress 2.5 +)
  • Add Sample Posts
  • Use sprite images
  • Compress the image size.
  • Properly indent the Css and js code


While developing a WordPress theme, one of the most important things to ensure is that your theme is fully compatible with the latest versions of all the major browsers.

  • Firefox
  • Internet Explorer 9, 10, 11
  • Google Chrome
  • Safari
  • Opera


Page templates are responsible for the appearance and layout of the page. They are highly specific and generally target an individual page on the website.

Also, naming the page templates gives the WordPress users who are editing the page more control over those specific templates. This section covers all the steps related to the template pages.

  • Index.php
    • Header.php
    • Sidebar.php
    • Footer.php
  • Single.php
  • Archive.php
  • Page.php
  • Home.php
  • Author.php
  • Comments.php
  • Search.php
  • Searchform.php
  • Category.php
  • 404.php
  • Functions.php


Now, before you go ahead, you need to make sure you have styled all the page elements including titles, images, videos, tables, etc, appropriately.

  • h1, h2, h3, h4, h5, h6
  • Captions
  • Images
  • Unordered lists
  • Blockquotes
  • Ordered lists
  • Tables


Next thing you need to do is make sure that all the images on your website are aligned properly. The CSS Classes were introduced in WordPress for this purpose.

WordPress 2.5 introduced many classes for aligning images and block elements (div, p, table, etc.), like alignleft, aligncenter, alignright. And if you need to align or style the images separately, you can use alignnone.

Similarly, the same CSS classes can be used for aligning images with captions.

  • .alignnone
  • .wp-caption
  • .aligncenter, div.aligncenter
  • .wp-caption.alignnone
  • .alignright
  • .wp-caption.alignleft
  • .alignleft
  • .wp-caption.alignright
  • a img.alignright
  • .wp-caption img
  • a img.alignnone
  • .wp-caption p.wp-caption-text
  • a img.alignleft
  • .screen-reader-text
  • a img.aligncenter
  • .screen-reader-text:focus


Now, you need to validate your CSS using the CSS Validation service. In the same way, also validate your HTML with the Markup Validation service.

  • Style.css

Add alt attribute to image tag

HTML (tip: browser > view source)
  • Index.php
  • The other templates.
  • With/without Comments
  • Login Required
  • Password Protected


The tags mentioned here are life savers when it comes to developing custom themes. Therefore, it is important that you have proper tags for all the different elements of your web pages in place, as shown below.

<?php include(TEMPLATEPATH . ‘/x’); ?>
<?php the_time('m‐d‐y') ?>
<?php /* Template Name: X */ ?>
<?php get_template_directory_uri(); ?>
<?php bloginfo('template_url'); ?>
instead of static links to files [images / .js / .css]
<?php define('VARIABLE','VALUE') ?>

for constant value
[For eg: Version 1.1 or Template directory link]

The loop
<?php if(have_posts()) : ?>
<?php while(have_posts()) :the_post(); ?>
<?php endwhile; ?>
<?php endif; ?>
For eg:
get_post_type( get_the_ID())=='POST_TYPE'
Generation of XML site map


Finally, ensure that all the style elements of your blog are taken care of, and you are good to go!

  • Title/Logo
  • Comments
  • Navigation of Pages
  • Copyright message
  • Navigation of Categories/Tags
  • Past/Next links
  • RSS links
  • Back to Top link
  • Search Form
  • Advertisements
  • Archives links
  • Add Function to unlink the links from the comment and add rel=”no_follow” attribute to the links while submitting the form
  • Social Sharing Links
  • Google Re-captcha on the Comment form
  • Dates/Timestamps