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
<!doctype html><html><head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta charset="utf-8"> | |
<link rel="dns-prefetch" href="//s2.me2j.com" /><link rel="dns-prefetch" href="//i2.me2j.com" /> | |
<!--[if lt IE 9]><script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> | |
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><![endif]--> | |
<title>Lapa</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> | |
<!-- | |
All other head parts | |
--> |
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 | |
/* | |
Plugin Name: Test | |
*/ | |
class My_Like_Button { | |
function __construct() | |
{ | |
$this->hooks(); | |
} |
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
/* | |
* goes in theme functions.php or a custom plugin | |
**/ | |
// add item to cart on visit | |
add_action( 'init', 'add_product_to_cart' ); | |
function add_product_to_cart() { | |
if ( ! is_admin() ) { | |
global $woocommerce; | |
$product_id = 64; | |
$found = false; |
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 | |
/* | |
via http://wordpress.stackexchange.com/a/15287/7577 | |
codex: http://codex.wordpress.org/Function_Reference/get_query_var | |
*/ | |
$termslug = get_query_var( 'term' ); | |
$taxoname = get_query_var( 'taxonomy' ); | |
$thisterm = get_term_by( 'slug', $termslug, $taxoname ); |
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 | |
/** | |
* Google Analytics Integration http://www.phpkode.com/source/s/woocommerce/woocommerce/classes/integrations/google-analytics/class-wc-google-analytics.php | |
* | |
* Allows tracking code to be inserted into store pages. | |
* | |
* @class WC_Google_Analytics | |
* @package WooCommerce | |
* @category Integrations | |
* @author WooThemes |
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 | |
/* redirect to with/without www version of page | |
* @date 2012-09-02 | |
*/ | |
if (substr($_SERVER['HTTP_HOST'],0,3) != 'www'){ | |
header('HTTP/1.1 301 Moved Permanently'); | |
header('Location: http://www.'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); | |
} |
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
RewriteEngine On | |
# with www | |
# RewriteCond %{HTTP_HOST} !^www\. | |
# RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] | |
# without www | |
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] |
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
<!-- | |
based on: | |
* https://gist.github.com/3259153 | |
* https://gist.github.com/3182211 | |
Full information: | |
http://simplemediacode.com/wordpress-pugins/itemprop-wp/ | |
--> | |
<span itemscope itemtype="http://schema.org/Article"> | |
<!-- Itemprop WP 3.3.5 by Rolands Umbrovskis http://umbrovskis.com --> | |
<meta itemprop="name" content="Title of the Article" /> |
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 | |
/* http://simplemediacode.info/snippets/better-page-title-with-and-without-yoast-wordpress-seo-plugin/ */ | |
?> | |
<title> | |
<?php if (!defined('WPSEO_VERSION')) { | |
// if there is no WordPress SEO plugin activated | |
wp_title(' | ', true, 'right'); | |
echo get_bloginfo('name') | |
.' '.get_bloginfo('description'); // or some WordPress default | |
}else { |
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
<!-- Twitter feed with < em> --> | |
<item> | |
<title>Es Tevi vēroju! http://t.co/yTu9nlFB</title> | |
<link>http://twitter.com/skatskat/statuses/247322950267699200</link> | |
<description>Es Tevi vēroju!<em> http:<em>/<em>/t.co/yTu9nlFB</em></description> | |
<pubDate>Sun, 16 Sep 2012 13:16:01 +0000</pubDate> | |
<guid>http://twitter.com/skatskat/statuses/247322950267699200</guid> | |
<author>skatskat@twitter.com (skatskat.lv 360° )</author> | |
<media:content type="image/jpg" height="48" width="48" url="http://a0.twimg.com/profile_images/1150354480/ziarfe_80x80_normal.jpg"/> | |
<google:image_link>http://a0.twimg.com/profile_images/1150354480/ziarfe_80x80_normal.jpg</google:image_link> |