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 | |
/** | |
* Obligatory alert of to use the thumbnail before publishing any article | |
*/ | |
function featured_image_requirement() { | |
if(!has_post_thumbnail()) { | |
wp_die( '<div>Your post is without thumbnail!</div><br><button class="button button-primary button-large" onclick="history.go(-1);">Back to posting</button>'); | |
} |
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 | |
// Nav Menu Dropdown Class | |
include_once( CHILD_DIR . '/lib/classes/nav-menu-dropdown.php' ); | |
/** | |
* Mobile Menu | |
* | |
*/ | |
function be_mobile_menu() { |
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 $helper = Mage::helper('cms'); | |
$processor = $helper->getPageTemplateProcessor(); | |
$html = $processor->filter($minha_variavel); ?> |
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 | |
/** | |
* Create Shopping Cart Sales Rule with Specific Coupon Code Programmatically | |
*/ | |
// All customer group ids | |
$customerGroupIds = Mage::getModel('customer/group')->getCollection()->getAllIds(); | |
// SalesRule Rule model | |
$rule = Mage::getModel('salesrule/rule'); |
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
## Website Sitemap | |
# Sitemap: http://www.example.com/sitemap.xml | |
## Crawlers Setup | |
User-agent: * | |
# Crawl-delay: 30 | |
## Do not crawl common Magento folders | |
Disallow: /app/ | |
Disallow: /downloader/ |
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 | |
$POPULATION = array(); //population of individuals | |
$POPULATION_SIZE = 100; | |
$DNA_SIZE = 12; | |
$GEN_COUNT = 1; | |
$TEST_COUNT = 0; | |
genInitPopulation(); | |
while (true) { | |
naturalSelection(); |
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
#! /bin/bash | |
# Sass: http://sass-lang.com/ | |
# Sass is a "smart" form of css, supporting nested targeting of html, variables and logic | |
# scss is a variant of sass using a syntax much closer to css | |
# Compass: http://compass-style.org/ | |
# Compass is a sass framework containing a range of shortcuts for cross-browser css effects. | |
# rounded corners, transparency... |
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 | |
/** @var Mage_Eav_Model_Entity_Setup $installer */ | |
$installer = $this; | |
$installer->startSetup(); | |
$this->addAttribute( | |
'catalog_category', | |
'my_custom_attribute', | |
array( | |
'group' => 'General Information', |
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
// JavaScript hasClass, addClass, removeClass | |
//source: http://www.avoid.org/?p=78 | |
function hasClass(el, name) { | |
return new RegExp('(\\s|^)'+name+'(\\s|$)').test(el.className); | |
} | |
function addClass(el, name) | |
{ | |
if (!hasClass(el, name)) { el.className += (el.className ? ' ' : '') +name; } |
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 | |
// yo can follow this guide to http://www.benrlodge.com/blog/post/how-to-generate-an-instagram-access-token# | |
#1 first you need to create a Client in Instgram Developer Dashboard | |
// https://www.instagram.com/developer/clients/manage/ | |
#2 after you need to retrive a oAuth code for after get access_token | |
// https://www.instagram.com/developer/authentication/ | |
// change the params with your one and open link in browser |
OlderNewer