WP No Category Base
で検索
2010年11月19日金曜日
wordpress メモ
Topに新着記事をのせるコード<div id="news">
<h3>新着情報</h3>
<dl>
<?php $myposts = get_posts('numberposts=5&orderby=post_date'); foreach($myposts as $post) : ?>
<dt><?php the_time('Y年n月j日'); ?></dt>
<dd><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></dd>
<?php endforeach; ?>
</dl>
</div>
<h3>新着情報</h3>
<dl>
<?php $myposts = get_posts('numberposts=5&orderby=post_date'); foreach($myposts as $post) : ?>
<dt><?php the_time('Y年n月j日'); ?></dt>
<dd><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></dd>
<?php endforeach; ?>
</dl>
</div>
wordpress メモ
パーマネントリンクでnot foundになった場合
.htaccess 666
AuthUserFile /**************/***/****
AuthGroupFile /dev/null
AuthName Protected Area
AuthType Basic
# BEGIN WordPress
;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
.htaccess 666
AuthUserFile /**************/***/****
AuthGroupFile /dev/null
AuthName Protected Area
AuthType Basic
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
2009年1月18日日曜日
背景リサイズやキャストの位置
まさかの公式紹介で、アクセス激増のため
自分にも分かりやすくして再投稿。ちなみに当方AS3初心者のため、初心者用のメモばかりです。trick7様やra66it様や公式のを拝見で勉強中。
ステージに対しての位置やリサイズ処理はキャストオブジェクトのonCastAddded内に。
800 * 600 の背景を常に縦横比維持でステージにfixさせたかったので、背景のクラスのonCastAdded内に書いてみました、動きました。リサイズ内のvarが余分。
縮小は80%がミニマム。
protected override function _onCastAdded():void {
//背景画像サイズ 800 * 600 使用
var backWidth:Number = 800;
var backHeight:Number = 600;
//現状のステージサイズを背景画像サイズで割って、ステージサイズまでの比率を取得
var xScale:Number = stage.stageWidth / backWidth;
var yScale:Number = stage.stageHeight / backHeight;
//0.8(80%)の縮小までありにして、最大(縦か横)の比率を取得
var fixScale:Number = Math.max(xScale,yScale,0.8);
//元の長さ * 上記の比率で縦横の長さを取得
width = backWidth * fixScale;
height = backHeight * fixScale;
//リサイズ時のイベント設定
stage.addEventListener( Event.RESIZE, function():void {
var backWidth2:Number = 800;
var backHeight2:Number = 600;
var xScale2:Number = stage.stageWidth / backWidth2;
var yScale2:Number = stage.stageHeight / backHeight2;
var fixScale2:Number = Math.max(xScale2,yScale2,0.8);
width = backWidth2 * fixScale2;
height = backHeight2 * fixScale2;
} );
addcommand内での直列/並列
分からず書いてたので再まとめ。
addcommand(
SerialListとParallelListを使用可能。
SerialListは[[ ]]
ParallelListは[ ]
で置き換え可能。
第一引数はnull。
サンプルコードをメモ牡蠣
直列
addcommand(
new SerialList( null,
new コマンド,
new コマンド,
)
);
もしくわ
addcommand(
[[
new コマンド,
new コマンド,
]]
);
並列
並列
addcommand(
new ParallelList( null,
new コマンド,
new コマンド
)
);
もしくわ
addcommand(
[
new コマンド,
new コマンド
]
);
fusekitみたいで楽
fusekitみたいで楽
登録:
投稿 (Atom)