This file contains hidden or 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 | |
/** | |
* @package datecontent_shortcode | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: 指定日時によって内容を表示するショートコード | |
Plugin URI: https://gist.github.com/2817701 | |
Description: WordPressの本文の内容を指定日時によって表示するショートコード。使い方は [datecontent opendate="YmdHi" closedate="YmdHi"]指定日時で表示する内容[/datecontent] です。opendate で表示の開始日時、closedate で表示の終了日時をYmdHiの形式で指定します。 | |
Author: gatespace |
This file contains hidden or 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: littleflag.com Hacks | |
Plugin URI: | |
Description: いろいろなスニペット | |
Version: 0.1 | |
Author: littleflag.com | |
Author URI: http://www.littleflag.com/ | |
このプラグインと同じ階層に /lf-func/ というディレクトリを作り、 |
This file contains hidden or 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 | |
/** | |
* post_classの出力するclassに、新着であれば、new-post、更新であれば、modified-postを追加する。 | |
* 条件分岐タグ : 新着かどうか is_new_post() 、更新かどうか is_modified_post | |
* ループ外で使う場合 : is_new_post( $new_post->post_date ) | |
* 設定した期間を異なる期間で判定(3日以内の更新かどうかを判定) : | |
* is_modified_post( $new_post->post_modified, 3 ) | |
* | |
* 参照 : http://www.warna.info/archives/2034/ | |
* |
This file contains hidden or 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 | |
/** | |
* 登録ユーザー限定コンテンツがある場合のフィードの本文 | |
*/ | |
function my_content_feed( $content ) { | |
$content = "※会員専用情報です。"; | |
return $content; | |
} | |
add_filter('the_content_feed', 'my_content_feed', 10, 2); | |
add_filter('the_excerpt_rss', 'my_content_feed', 10, 2); |
This file contains hidden or 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
# 出典 http://ja.forums.wordpress.org/topic/8980 | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example.com [NC] | |
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L] | |
</IfModule> |
This file contains hidden or 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 | |
/* | |
* カスタム投稿タイプ「research」の投稿画面に | |
* カスタム投稿タイプ「teacher」の投稿一覧のメタボックスを追加する(チェックボックス編) | |
* teacherの投稿IDをresearchのカスタムフィールド「teacher_ID」に配列で保存 | |
*/ | |
add_action( 'add_meta_boxes', 'add_teacher_list_box' ); | |
function add_teacher_list_box() { | |
add_meta_box('teacher_list', '教員一覧', 'teacher_list_custom_box', 'research', 'side', 'low'); |
This file contains hidden or 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: カスタム投稿タイプと専用ユーザー権限 | |
Plugin URI: | |
Description: カスタム投稿タイプ「report」とカスタムタクソノミー「reportcat」を作成し、専用の権限グループ「レポート投稿者(report_author)」を作成します。 | |
Author: Your Name | |
Version: 1.0 | |
Author URI: | |
*/ |
This file contains hidden or 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://memo.dogmap.jp/2012/04/16/wordpress-fix-date-archive-title/ | |
*/ | |
function jp_date_archive_wp_title( $title ) { | |
if ( is_date() ) { | |
$title = ''; | |
if ( $y = intval(get_query_var('year')) ) |
OlderNewer