This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$link = mysql_connect('localhost', 'root', 'password'); | |
if (!$link) { | |
die('Could not connect: ' . mysql_error()); | |
} | |
echo 'Connected!'; | |
mysql_close($link); | |
?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // define ?> | |
<?php $thumb_id = get_post_thumbnail_id(); $thumb_url = wp_get_attachment_image_src($thumb_id,'steecky', true);?> | |
<?php // get ?> | |
<?php echo $thumb_url[0]; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Wordpress | |
* Useful when you need to resize an image on the go with; http://i0.wp.com/ | |
*/ | |
?> | |
<?php // define + trim ?> | |
<?php | |
$thumb_id = get_post_thumbnail_id(); $thumb_url = wp_get_attachment_image_src($thumb_id,'steecky', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?php | |
$store_id = Mage::app()->getStore()->getId(); | |
$_productCollection = Mage::getResourceModel('reports/product_collection') | |
->addStoreFilter($store_id) | |
->addAttributeToFilter('visibility', 4) | |
->addAttributeToFilter('status', 1) | |
->addAttributeToSelect('*') | |
->setVisibility(array(2,3,4)) | |
->setOrder('created_at', 'desc') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Change default e-mail address and name on outgoing e-mails sent by WordPress. | |
// code goes in your theme functions.php | |
// New Email | |
function sb_new_mail_from( $email ) { | |
$email = 'info@yoursite.com'; // change | |
return $email; | |
} | |
add_filter( 'wp_mail_from', 'sb_new_mail_from' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
login url | |
<?php echo Mage::getUrl('customer/account/login'); ?> | |
logout url | |
<?php echo Mage::getUrl('customer/account/logout'); ?> | |
My Account url | |
<?php echo Mage::getUrl('customer/account'); ?> | |
Register url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
+ If you want, you can set manually the '$storeId' with the number (id) of the desired store. | |
+ You can also change 'Mage_Core_Model_Store::URL_TYPE_LINK' with one of these: | |
- Mage_Core_Model_Store::URL_TYPE_JS | |
- Mage_Core_Model_Store::URL_TYPE_LINK | |
- Mage_Core_Model_Store::URL_TYPE_MEDIA | |
- Mage_Core_Model_Store::URL_TYPE_SKIN | |
- Mage_Core_Model_Store::URL_TYPE_WEB |
OlderNewer