2013年1月14日 星期一

scrolltop chrome firefox某一項無作用


原本這樣用
$('body').stop().delay(800).stop().animate({
scrollTop:0
}, 800);
但常常firefox無作用
於是加入下面html就可
$('body,html').stop().delay(800).stop().animate({
scrollTop:0
}, 800);

2013年1月10日 星期四

wordpress取得目前POST文章的路徑名稱 或是文章 ID


<?php
$pagename = get_query_var('pagename');
if ( !$pagename && $id > 0 ) {
// If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
$post = $wp_query->get_queried_object();
 $pagename = $post->post_name;//目前文章 名稱
}
 $postid = get_the_ID();//目前文章ID

?>