Skip to content

Instantly share code, notes, and snippets.

View ScarletPonytail's full-sized avatar

ScarletPonytail ScarletPonytail

View GitHub Profile
@ScarletPonytail
ScarletPonytail / header.php
Created April 26, 2017 08:01
WordPress - Calling template partials / parts into theme files
01. Create a new .php file and put your template parts into it, such as the menu, the image slider etc
02. Call the template partial into them theme file using the below:
<?php get_template_part( 'main-menu' ); ?>
@ScarletPonytail
ScarletPonytail / functions.php
Created April 26, 2017 07:50
WordPress - Add jQuery
// smart jquery inclusion
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', ("https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"), false);
wp_enqueue_script('jquery');
}
@ScarletPonytail
ScarletPonytail / functions.php
Created April 26, 2017 07:48
WordPress - Remove unwanted crap from header
// remove junk from head
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0);
@ScarletPonytail
ScarletPonytail / translate.csv
Created April 21, 2017 14:17
Magento - Update 'My Cart' on popup in smaller viewports
My Cart (%s item) My Basket (%s item)
My Cart (%s items) My Basket (%s items)
@ScarletPonytail
ScarletPonytail / gist:45770e65e6a12cbeb910fe56cc24dea9
Created April 20, 2017 08:42
Magento - How to disable customer reviews
1. Navigate to System > Configuration > Advanced.
2. Disable ‘Mage_Review’.
@ScarletPonytail
ScarletPonytail / gist:162418f75f773d9f7d147f94f3699d21
Created April 20, 2017 08:41
Magento - How to remove the Compare links site-wide
This can only be achieved by installing an extension:
I have already downloaded the extension and saved it in the Magento folder, you can just install it locally within the Magento Connect area.
Link: http://www.magentocommerce.com/magento-connect/remove-compare.html
@ScarletPonytail
ScarletPonytail / gist:d255805f3f4b6b6944967b65ea53ccf6
Created April 20, 2017 08:40
Magento - How to remove the Wishlist
01. Navigate to ‘System > Configuration > Customers > Wishlist’.
02. Dropdown ‘General Options’.
03. Change ‘Enabled’ to ‘No’.
04. Click ‘Save Config’.
@ScarletPonytail
ScarletPonytail / gist:85df6abf467cfa787916a42245004847
Created April 20, 2017 08:38
Magento - How to show all items on a category page
System > Configuration > Catalog > Frontend > ‘Allow All products per Page’
Change setting to ‘Yes’.
@ScarletPonytail
ScarletPonytail / fonts.js
Last active April 20, 2017 08:34
Magento - How to add Google Fonts to a Magento theme
WebFontConfig = {
google: { families: ['Source+Sans+Pro:400,700:latin', 'Lobster::latin', 'Unica+One::latin'] },
timeout: 2000 // Set the timeout to two seconds
};
(function () {
// NEEDED to push the wf-loading class to your head (fontloader does it too late!)
// its done this way to reliably work on IE and other browsers…
document.getElementsByTagName("html")[0].className = "wf-loading";
@ScarletPonytail
ScarletPonytail / style.css
Last active March 19, 2018 15:38
CSS - Media Queries
@media (min-width: 768px) {
/* Your awesome code */
}
@media (min-width: 768px) and (max-width: 1240px) {
/* Your awesome code */
}