Skip to content

Instantly share code, notes, and snippets.

@tenman
tenman / add-link-on-header.markdown
Last active April 2, 2019 05:19
add link on header
@tenman
tenman / functions.php
Last active November 20, 2015 02:46
WordPress Raindrops Theme. Featured icon size chenge. on index,archives. paste only between code paste start and code paste end. ver 1.336 after.
<?php
// code paste start
add_image_size( 'archive_featured_icon', 100, 50, true );// 100 is width(px) 50 is height(px)
add_filter('raindrops_post_thumbnail_size_main_query','my_post_thumbnail_size_custom' );
add_filter('raindrops_embed_meta_css', 'my_archive_thumbnail_size_custom_style' );
function my_post_thumbnail_size_custom( $size ) {
return 'archive_featured_icon';
@tenman
tenman / functions.php
Created June 4, 2014 00:08
Quick Fix Raindrops theme bug. add to functions.php first line(<?php before ) below codes
<?php
/**
* category posts
*
*
*
*
*/
function raindrops_category_posts( $args = '' ) {
@tenman
tenman / functions.php
Last active August 29, 2015 14:01
show all category posts
function raindrops_category_id2name( $str ) {
$id = ( int ) $str;
return get_cat_name( $id );
}
function raindrops_reset_val( $str ) {
return 0;
}
function compare_capital_lower_not_distinguish( $a, $b ) {
@tenman
tenman / home.php
Created May 16, 2014 07:00
recent posts each categories
<?php
/* カテゴリIDをキーとした配列の作成 */
$category_ids = array_flip( get_all_category_ids() );
$category_ids = array_map( "reset_val", $category_ids );
/* 表示する投稿の件数(最大) */
$limit_posts = 5;
function reset_val( $str ) {
return 0;
@tenman
tenman / functions.php
Last active August 29, 2015 14:01
Add description and keyword
<?php
/* サイトキーワード と概要 */
add_filter( 'the_generator', 'generator2description' );
function generator2description( $content ) {
global $post;
$result = '';
if ( is_front_page() || is_home() ) {
$result .= $content . "\n";
@tenman
tenman / loop.php
Created March 25, 2014 02:06
Raindrops child theme loop.php for test
<?php
/**
* Template for display loops.
*
* @package Raindrops
* @since Raindrops 0.1
*/
if ( ! defined( 'ABSPATH' ) ) { exit; }
?>
<?php
@tenman
tenman / functions.php
Created March 8, 2014 23:30
Go to Top and Menu Fixed functionality at Raindrops WordPress Theme
<?php
/**
* Menu fixed
*
*
*
*/
define('NOBITA_QUERY', 'nobita_fixed_menu' );
define('NOBITA_VALUE_TYPE', 'js'); //or css
@tenman
tenman / functions.php
Created March 5, 2014 05:02
WordPress theme Raindrops wp_nav_menu() show allways fixed page top.
<?php
/**
* Menu fixed
*
*
*
*/
define('NOBITA_QUERY', 'nobita_fixed_menu' );
define('NOBITA_VALUE_TYPE', 'js'); //または、css
@tenman
tenman / test.php
Last active August 29, 2015 13:56
Raindrops template shows category name and post links
<?php
/*
* Template Name: test
*/
get_header('html5');
?><div style="margin:5%;-moz-columns: 15em auto;-webkit-columns:15em auto;-o-columns: 15em auto;-ms-columns: 15em auto;">
<?php
$categories = get_all_category_ids();