Skip to content

Instantly share code, notes, and snippets.

@hitsujixgit
hitsujixgit / mybxslider.js
Created August 21, 2014 04:06
Call bxSlider
/**
* call bxSlider
*/
$(function($) {
var mySlider = $('.bxslider').bxSlider({
auto: true,
speed: 1000,
pause: 500,
mode: 'fade',
captions: false,
@hitsujixgit
hitsujixgit / slideshow-template.php
Created August 21, 2014 03:59
How to add bxSlider to Wordpress's templates.
<?php
$header_images = get_uploaded_header_images();
if ($header_images) {
echo '<ul class="bxslider">';
foreach ($header_images as $key => $value) {
echo '<li><img src="'.$value['url'].'" /></li>';
}
echo '</ul>';
} else {
echo '<img id="frontpage-image" src="'.get_template_directory_uri().'/img/sky_2x.jpg" width="900" height="200" />';
@hitsujixgit
hitsujixgit / functions.php
Created August 21, 2014 01:36
Enable custom header on WordPress
// カスタムヘッダーを有効にする
$custom_header_defaults = array(
'default-image' => get_bloginfo('template_url').'/img/sky_2x.jpg',
'width' => 1800,
'height' => 400,
'header-text' => false, //ヘッダー画像上にテキストをかぶせる
);
add_theme_support( 'custom-header', $custom_header_defaults );
@hitsujixgit
hitsujixgit / add_user.html
Created August 19, 2014 05:55
Implemented add-user function.
{% extends "base.html" %}
{% block title_html %}
Add user form
{% endblock %}
{% block h1 %}
Add user form
{% endblock %}
{% block article_content %}
<form method="post" action="{{ add_user }}">
{% csrf_token %}
@hitsujixgit
hitsujixgit / index.html
Created August 19, 2014 05:44
Implemented logout function.
{% extends "base.html" %}
{% block title_html %}
Django Test Page
{% endblock %}
{% block h1 %}
Hello world
{% endblock %}
{% block article_content %}
<p>Welcome to Django world!</p>
<p><a href="login">Your Account</a></p>
@hitsujixgit
hitsujixgit / login.html
Created August 19, 2014 05:24
Implemented login function.
{% extends "base.html" %}
{% block title_html %}
User login form
{% endblock %}
{% block article_content %}
{% if user.is_authenticated %}
<!-- Authenticated. -->
<h1>You are connected.</h1>
<p>Your email : {{ user.email }}</p>
<p><a href="/">Return to home</a></p>
@hitsujixgit
hitsujixgit / index.html
Created July 31, 2014 11:48
Add 2 line labels to a Yokohama city map.
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v0.min.js"></script>
<style type="text/css">
h1 {
font-size: 16px;
}
@hitsujixgit
hitsujixgit / index.html
Created July 29, 2014 07:04
Add labels of population values to yokohama city map.
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v0.min.js"></script>
<style type="text/css">
h1 {
font-size: 16px;
}
@hitsujixgit
hitsujixgit / category-information-acquisition.php
Created July 29, 2014 02:20
A customized WordPress template for a specific category page.
<?php get_header(); ?>
<!-- メイン -->
<div id="content">
<div id="main">
<article class="post">
<?php
if(is_category()) {
$obj = get_queried_object();
$title = '<span>「'.get_cat_name($obj->term_id).'」</span>の記事';
} elseif (is_tag()) {
@hitsujixgit
hitsujixgit / index.html
Created July 25, 2014 01:30
Show yokohama city map filled with colors according to population.
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v0.min.js"></script>
<style type="text/css">
h1 {
font-size: 16px;
}