This file contains 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 $posts = get_posts(array('post_type' => 'one_line_comment', 'taxonomy' => 'span', 'posts_per_page' => 5, 'order' => 'ASC')); foreach($posts as $post) : setup_postdata($post); //1行コメントの改訂版 ?> | |
<?php | |
$key = "表示期間"; //カスタムフィールドの項目名(label) | |
$value = get_post_meta($post->ID, $key, true); //カスタムフィールドに入れた日数を格納 | |
//↑↑ココまでがカスタムフィールドの項目を出力する部分 | |
$value_unix = $value * 24 * 60 * 60; | |
//▼ここで日付を整形。sbustrで最初の文字から○文字を抜き出し(一文字目は「0(ゼロ)」)、str_replaceで置き換えたい文字と置き換える文字を指定。 | |
$toukoubi = str_replace("-", "/", substr($post->post_date, 0, 10)); //投稿日の日付 YYYY/mmmm/dddd | |
$last_modified_day = str_replace("-", "/", substr($post->post_modified, 0, 10)); //最終編集日の日付 YYYY/mmmm/dddd | |
//▲ここで日付を整形。sbustrで最初の文字から○文字を抜き出し(一文字目は「0(ゼロ)」)、str_replaceで置き換えたい文字と置き換える文字を指定。 |
This file contains 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 | |
/* | |
現在の日時から2日後のタイムスタンプを保存する | |
$d = 2 * 60 * 60 * 24; // 2日間 | |
$expire = current_time('timestamp', get_option("gmt_offset")) + $d; | |
update_post_meta($post->ID, '_expire', $expire); |
This file contains 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 | |
$args = array ( | |
'post_type' => 'one_line_comment', | |
'taxonomy' => 'span', | |
'post_per_page' => 5, | |
'order' => 'ASC', | |
'meta_key' => $disply_limit, | |
'meta_value' => $now, | |
'meta_compare' => '>' |
This file contains 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 html_source_for_layout_custom_box() { | |
$c_text = get_post_meta( $_GET['post'], 'c_text' ); | |
echo '<label for="c_text">テキスト</label> '; | |
echo '<input type="text" name="c_text" value="'.$c_text[0].'">'; | |
} |
This file contains 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 | |
/****************************************************************************/ | |
/* ! ▼register_post_typeのregister_meta_box_cbのコールバックここから | |
参考URL:http://wpxtreme.jp/how-to-use-custom-post-types-in-wordpress-3-0-beta1 | |
http://wpdocs.sourceforge.jp/関数リファレンス/add_meta_box | |
http://ja.forums.wordpress.org/topic/4693?replies=4 | |
*/ |
This file contains 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
<script type="text/javascript"> | |
$(function() { | |
$.fn.slide = function(config) { | |
// 引数がない場合のデフォルト値の設定 | |
config = $.extend({ | |
loopSpeed: 3000, | |
fadeInSpeed: 2000, | |
fadeOutSpeed: 2000 | |
}, config); |
This file contains 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 | |
/****************************************************************************/ | |
/* ! ▼register_post_typeのregister_meta_box_cbのコールバックここから | |
参考URL:http://wpxtreme.jp/how-to-use-custom-post-types-in-wordpress-3-0-beta1 | |
http://wpdocs.sourceforge.jp/関数リファレンス/add_meta_box | |
http://ja.forums.wordpress.org/topic/4693?replies=4 | |
*/ |
This file contains 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
<script type="text/javascript"> | |
$(function() { | |
var _li = $("li.one_line_news"); | |
var _ul = $("#one_line"); | |
var _li_width = 877; | |
var _li_size = _li.size(); | |
var _numberOf_li = _li_size - 1; | |
var _count = 0; | |
var _ul_width = _li_width * _li_size; | |
var _ul_margin = 0; |
This file contains 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 | |
/** | |
* The main template file. | |
* | |
* This is the most generic template file in a WordPress theme | |
* and one of the two required files for a theme (the other being style.css). | |
* It is used to display a page when nothing more specific matches a query. | |
* E.g., it puts together the home page when no home.php file exists. | |
* Learn more: http://codex.wordpress.org/Template_Hierarchy | |
* |
This file contains 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 //its a test php code ?> |
OlderNewer