Skip to content

Instantly share code, notes, and snippets.

View ywnb's full-sized avatar

やわなべ ywnb

View GitHub Profile
@ywnb
ywnb / 2541-1.php
Last active September 23, 2015 07:37
/*------------------------------------------------------
page description
-------------------------------------------------------*/
function get_description(){
global $post;
$desc = get_bloginfo('description');
if(is_single() or is_page()){
if(has_excerpt()){
$desc = get_the_excerpt();
}else{
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php wp_head(); ?>
<?php get_ogp(); ?>
<!DOCTYPE html>
<html <?php language_attributes();?>>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php wp_title ( '|', true,'right' ); ?><?php bloginfo('name'); ?></title>
<link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/style.css">
<?php wp_head(); ?>
</head>
<body>
<div class="error">
<p>ページが見つかりません</p>
</div>
<div class="single">
<?php while ( have_posts() ): the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class('group'); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>
<div>
<span class="author">投稿者:<?php the_author(); ?></span>
<span class="category">カテゴリ:<?php the_category(' / '); ?></span>
<span class="tags">タグ:<?php the_tags('', ' / ', ''); ?></span>
<span class="published">公開日:<?php the_time('Y/m/d'); ?></span>
<span class="updated">更新日:<?php the_modified_date('Y/m/d'); ?></span>
<div class="archive">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>">
<?php if ( has_post_thumbnail() ): ?>
<div><a href="<?php the_permalink() ?>"><?php the_post_thumbnail('thumb'); ?></a></div>
<?php endif; ?>
<div><span><?php the_category(' / '); ?></span> <span><?php the_time('Y/m/d'); ?></span></div>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<span><?php echo the_excerpt(); ?>...<a href="<?php the_permalink() ?>">[続きを読む]</a></span>
<ul>
<!-- サイト内検索 -->
<li class="widget"><h2 class="widgettitle">サイト内検索</h2>
<?php get_search_form(); ?>
</li>
<!-- カテゴリー -->
<li class="widget"><h2 class="widgettitle">カテゴリー</h2>
<ul><?php wp_list_categories(array('show_count'=>1,'title_li' => '')); ?></ul>
</li>
/*
Theme Name: ywnb-minimum
Description: Wordpress theme for minimalist
Author: ywnb.net
Template: minimum
Version: 0.0.1
*/
<?php
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles', 10 );
add_filter( 'wpcf7_load_js', '__return_false' );
add_filter( 'wpcf7_load_css', '__return_false' );
?>
function gmailCleanUp() {
var delayDays = 365; // Enter # of days before messages are moved to trash
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays);
var step = 100;
var start = 0;
var threads = GmailApp.getInboxThreads(start, step);
var deleteCount = 0;