Skip to content

Instantly share code, notes, and snippets.

Asif asifsomy

Block or report user

Report or block asifsomy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View get_social_links()
@asifsomy
asifsomy / .htaccess
Created Apr 4, 2017
Wordpress: Pull remote images while working in localhost
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /SITENAME.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^127\.0\.0\.1$
RewriteRule ^wp-content/uploads/(.*)$ http://SITENAME.com/wp-content/uploads/$1 [NC,L]
</IfModule>
@asifsomy
asifsomy / addCats.php
Last active Jan 28, 2016
Create Bulk Magento Categories
View addCats.php
<?php
$cats = array(
'Name' => 'Description.',
);
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
@asifsomy
asifsomy / functions.php
Last active Jan 6, 2016
Remove Unwanted Archive URLs
View functions.php
function cd_remove_unwanted_archives(){
if( is_search() || is_category() || is_tag() || is_date() || is_author() ) {
global $wp_query;
$wp_query->set_404();
}
}
add_action('template_redirect', 'cd_remove_unwanted_archives');
@asifsomy
asifsomy / WrapDivs.php
Last active Jan 6, 2016
Wrap n number of divs into a parent div
View WrapDivs.php
<?php
$i=0;
$wrap_count = 4; // you can change this no of divs to wrap
foreach ($categories as $category)
{
$i+=1;
if($i%$wrap_count==1)
echo '<div class="row">';
?>
<div class="col-lg-3 col-md-3">.....</div>
@asifsomy
asifsomy / functions.php
Last active Aug 29, 2015 — forked from redesigned/functions.php
Wordpress Magento Cross Integration
View functions.php
/* ===================================== */
/* Add This to Wordpress's /wp-content/yourtheme/functions.php file */
define('MAGENTO_ROOT', '/Volumes/Storage/www/heartandsun/store/');
define('MAGENTO_LOADER', MAGENTO_ROOT.'app/Mage.php');
if (!class_exists('Mage')) {
require_once(MAGENTO_LOADER);
umask(0);
Mage::app("default");
};
/* ===================================== */
@asifsomy
asifsomy / wpcf-form-triggers.css
Last active Feb 10, 2018
Contact from 7 On Submit, Invalid, Spam, MailSent, Mail Failed JS triggers
View wpcf-form-triggers.css
div.wpcf7 img.ajax-loader{display:none; margin:5px auto 0;}
You can’t perform that action at this time.