Skip to content

Instantly share code, notes, and snippets.

View eridesigns's full-sized avatar
🏠
Working from home

Eri Mehmeti eridesigns

🏠
Working from home
View GitHub Profile
@eridesigns
eridesigns / html_email_buttons_1.html
Created June 3, 2021 13:58 — forked from elidickinson/html_email_buttons_1.html
HTML email buttons that work
<div>
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="http://www.EXAMPLE.com/" style="height:40px;v-text-anchor:middle;width:300px;" arcsize="10%" stroke="f" fillcolor="#d62828">
<w:anchorlock/>
<center style="color:#ffffff;font-family:sans-serif;font-size:16px;font-weight:bold;">
Button Text Here!
</center>
</v:roundrect>
<![endif]-->
<![if !mso]>
@eridesigns
eridesigns / function.php
Created March 4, 2021 22:58 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}
@eridesigns
eridesigns / .gitignore
Created March 3, 2021 10:31 — forked from drblue/.gitignore
.gitignore for (local) Wordpress theme development
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# Originaly from http://ironco.de/bare-minimum-git/
# ver 20150130
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@eridesigns
eridesigns / gitignore-for-wordpress-theme
Created March 3, 2021 10:30 — forked from jasewarner/gitignore-for-wordpress-theme
.gitignore for a WordPress theme
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore everything in the "wp-content" directory, except:
# mu-plugins, plugins, and themes directories
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
@eridesigns
eridesigns / functions.php
Created January 28, 2021 03:31 — forked from maddisondesigns/functions.php
WooCommerce Custom Fields for Simple & Variable Products
/*
* Add our Custom Fields to simple products
*/
function mytheme_woo_add_custom_fields() {
global $woocommerce, $post;
echo '<div class="options_group">';
// Text Field
<?php
$to = "[email protected]";
$subject = "Learning how to send an Email in WordPress";
$content = "WordPress knowledge";
$headers = array(
'Reply-To' => "Gustavo Bordoni <[email protected]>"
);
$status = wp_mail($to, $subject, $content, $headers);
@eridesigns
eridesigns / super_walker.php
Created January 28, 2015 04:33
Showing description text from WordPress menus
<?php
//add this to your functions.php
class super_walker extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
#######################################################################################################################################
#
# VIM cheatsheet
# http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/
#
#######################################################################################################################################
# Diff two files
:edit file1
@eridesigns
eridesigns / ssh-cheatsheet
Last active August 29, 2015 14:09
SSH Terminal Cheatsheet
//going to a desired folder
cd /folder/something/
//back to the previews folder(directory)
cd ..
//back to the home directory
cd ~
//shows all the folders and files
@eridesigns
eridesigns / index.php
Last active August 29, 2015 14:08 — forked from jameskoster/index.php
<ul class="products">
<?php
$args = array(
'post_type' => 'product',
'posts_per_page' => 12
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
woocommerce_get_template_part( 'content', 'product' );