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);
#######################################################################################################################################
#
# VIM cheatsheet
# http://yanpritzker.com/2011/12/16/learn-to-speak-vim-verbs-nouns-and-modifiers/
#
#######################################################################################################################################
# Diff two files
:edit file1
@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' );
$custom_terms = get_terms('custom_taxonomy');
foreach($custom_terms as $custom_term) {
wp_reset_query();
$args = array('post_type' => 'custom_post_type',
'tax_query' => array(
array(
'taxonomy' => 'custom_taxonomy',
'field' => 'slug',
'terms' => $custom_term->slug,
function fn_googleMaps($atts, $content = null) {
extract(shortcode_atts(array(
"width" => '640',
"height" => '480',
"src" => ''
), $atts));
return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'"></iframe>';
}
add_shortcode("googlemap", "fn_googleMaps");