Skip to content

Instantly share code, notes, and snippets.

.round {
/* Safari 3-4, iOS 1-3.2, Android 1.6- */
-webkit-border-radius: 12px;
/* Firefox 1-3.6 */
-moz-border-radius: 12px;
/* Opera 10.5, IE 9, Safari 5, Chrome, Firefox 4, iOS 4, Android 2.1+ */
border-radius: 12px;
}
@ingozoell
ingozoell / nth-child-for-old-ie.css
Last active December 27, 2015 08:19
Add :nth-child support for old IE
.oldie ul li.every-3rd {background: #999;}
ul li:nth-child(3n+3) {background: #999;} /* modern browser */
@ingozoell
ingozoell / cross-browser-border-radius.css
Created November 4, 2013 12:31
Cross-Browser border-radius support (+http://css3pie.com/ )
.border-radius {
-webkit-border-radius: 12px; /* Safari 3-4, iOS 1-3.2, Android 1.6- */
-moz-border-radius: 12px; /* Firefox 1-3.6 */
border-radius: 12px; /* Opera 10.5, IE 9, Safari 5, Chrome, Firefox 4, iOS 4, Android 2.1+ */
}
/* Support via CSS3 PIE http://css3pie.com/ */
.pie { behavior: url(http://iz-multisite.de/cms/PIE.php); }
<?php
class WP_HTML_Compression {
protected $compress_css = true;
protected $compress_js = true;
protected $info_comment = true;
protected $remove_comments = true;
protected $html;
public function __construct($html) {
if (!empty($html)) {
function adjust_admin_bar()
{
global $wp_admin_bar;
if (!is_admin_bar_showing() or !is_admin())
{
return;
}
$form = '<form action="' . esc_url(admin_url('edit.php')) . '" method="get" id="adminbarsearch">';
$form.= '<input class="adminbar-input" name="s" tabindex="1" type="text" value="" maxlength="50" />';
<?php
function default_category_featured_image()
{
global $post;
$featured_image_exists = has_post_thumbnail($post->ID);
if (!$featured_image_exists)
{
$attached_image = get_children("post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1");
if ($attached_image)
{
<?php
function autoset_featured() {
global $post;
$already_has_thumb = has_post_thumbnail($post->ID);
if (!$already_has_thumb) {
$attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
if ($attached_image) {
foreach ($attached_image as $attachment_id => $attachment) {
set_post_thumbnail($post->ID, $attachment_id);
}
@ingozoell
ingozoell / Mobile-Viewport-Meta.html
Created January 18, 2014 17:06
Mobile Viewport Meta
<!-- Mobile viewport optimization -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="0">
<meta name="viewport" content="width=device-width">
/* All Admin Settings */
function all_settings_link() {
add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php');
}
add_action('admin_menu', 'all_settings_link');
functions.php