Magento: Display category & sub-category with thumbnail

<?php $_helper = Mage::helper('catalog/category') ?>
	<?php $_categories = $_helper->getStoreCategories() ?>
	<?php if (count($_categories) > 0): ?>
		<?php foreach($_categories as $_category): ?>
  <a href="<?php echo $_helper->getCategoryUrl($_category) ?>">
                <?php echo $_category->getName() ?>
            </a>
				<?php $_category = Mage::getModel('catalog/category')->load(11) ?>
				<?php $_subcategories = $_category->getChildrenCategories() ?>
				<?php if (count($_subcategories) > 0): ?>
				<ul>
			        <?php foreach($_subcategories as $_subcategory): ?>
					<li>
						<a href="<?php echo $_helper->getCategoryUrl($_subcategory) ?>">
		                	<?php echo $_subcategory->getName() ?>
							<?php echo '<img src="' . Mage::getBaseUrl('media').'catalog/category/'. Mage::getModel('catalog/category')->load($_subcategory->getId())->getThumbnail() . '" />'; ?>
						</a>
	                </li>
	            	<?php endforeach; ?>
	        	</ul>
			<?php endif; ?>
		<?php endforeach; ?>
	<?php endif; ?>

The above code list the subcategories that is inside category id 11. For to get the thumbnail of category we need to upload image while creating the categories

Magento: get skin url, get media url, get base url, get store url

Magento Mage Core, Admin Static Blocks, or Phtml edits are usually includes getting url path such images, javascript, base url, media and store url. There are different ways to retrieve mentioned URL paths depending on where section you’re editing.

To Retrieve URL path in STATIC BLOCK

To get SKIN URL

{{skin url='images/sampleimage.jpg'}}

To get Media URL

{{media url='/sampleimage.jpg'}}

To get Store URL

{{store url='mypage.html'}}

To get Base URL

{{base url='yourstore/mypage.html'}}

TO Retrieve URL path in PHTML

Note: In editing PHTML don’t forget to enclode the following code with PHP tag
Not secure Skin URL:

<?php echo $this->getSkinUrl('images/sampleimage.jpg') ?>

Secure Skin URL

<?php echo $this->getSkinUrl('images/ sampleimage.gif', array('_secure'=>true)) ?>

Get  Current URL

$current_url = Mage::helper('core/url')->getCurrentUrl();

Get Home URL

$home_url = Mage::helper('core/url')->getHomeUrl();

Get Magento Media Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);


Get Magento Media Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

Get Magento Skin Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

Get Magento Store Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

Get Magento Js Url

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
Source:
http://www.webdosh.net/2011/04/magento-get-skin-url-get-media-url-get.html

Add Custom JavaScript and Stylesheet in wordpress

We can directly put it in the header section as we normal does but sometime it maynot work in case of admin.
We can include following code in function.php

function mytheme_custom_scripts() {

	if ( ! is_admin() ) {
		$scriptsrc = get_stylesheet_directory_uri() . '/js/';
		wp_register_script( 'myhandle', $scriptsrc . 'myscript.js', 'jquery', false );
		wp_enqueue_script( 'myhandle' );
	}

}
add_action( 'wp_enqueue_scripts', 'mytheme_custom_scripts' );

and for case of css add the following code

 wp_enqueue_style('thickbox', get_bloginfo('siteurl') . 'wp-includes/js/thickbox/thickbox.css', false, false, 'screen');
        wp_enqueue_script('mthickbox');
Source:http://wordpress.org/support/topic/how-can-i-add-custom-javascript-and-stylesheet-in-headerphp-file-1

Magento Internal server error (500) in live server

While moving the localhost magento site to live hosting , everytime i get Internal server error (500) error .
To Overcome this error we need to follow certain steps.
->set permission 755 for magento folder and index.php
->Sometimes this can be related to the .htaccess rewritebase rule , while working on localhost host its may consist the folder in the path but while it is live we install it in the root directory so .htacces should be pointed to base …

RewriteBase /