구글 블로그 하단 페이지 네비게이션
-
아래 코드를 찾습니다.
<b:includable id='mobile-index-post' var='post'> -
1번 코드 다음줄에 아래코드를 붙여넣습니다.
<b:includable id='page-navi'> <div class='pagenavi'> <script type="text/javascript"> //참고자료 : http://yourjavascript.com/815315225/www.mybloggerblog.com.js //<![CDATA[ var pageNaviConf = { perPage: 7, numPages: 5, firstText: "First", lastText: "Last", nextText: "»", prevText: "«" } function pageNavi(o){var m=location.href,l=m.indexOf("/search/label/")!=-1,a=l?m.substr(m.indexOf("/search/label/")+14,m.length):"";a=a.indexOf("?")!=-1?a.substr(0,a.indexOf("?")):a;var g=l?"/search/label/"+a+"?updated-max=":"/search?updated-max=",k=o.feed.entry.length,e=Math.ceil(k/pageNaviConf.perPage);if(e<=1){return} var n=1,h=[""];l?h.push("/search/label/"+a+"?max-results="+pageNaviConf.perPage):h.push("/?max-results="+pageNaviConf.perPage);for(var d=2;d<=e;d++){var c=(d-1)*pageNaviConf.perPage-1,b=o.feed.entry[c].published.$t,f=b.substring(0,19)+b.substring(23,29);f=encodeURIComponent(f);if(m.indexOf(f)!=-1){n=d} h.push(g+f+"&max-results="+pageNaviConf.perPage)} pageNavi.show(h,n,e)} pageNavi.show=function(f,e,a){var d=Math.floor((pageNaviConf.numPages-1)/2), g=pageNaviConf.numPages-1-d,c=e-d;if(c<=0){c=1} endPage=e+g;if((endPage-c)<pageNaviConf.numPages){endPage=c+pageNaviConf.numPages-1} if(endPage>a){endPage=a;c=a-pageNaviConf.numPages+1} if(c<=0){c=1} var b='<span class="showpageOf">Page '+e+' of '+a+"</span> ";if(c>1){b+='<span class="showpageNum"><a href="'+f[1]+'">'+pageNaviConf.firstText+"</a></span>"} if(e>1){b+='<span class="showpageNum"><a href="'+f[e-1]+'">'+pageNaviConf.prevText+"</a></span>"} for(i=c;i<=endPage;++i){if(i==e){b+='<span class="showpagePoint">'+i+"</span>"}else{b+='<span class="showpageNum"><a href="'+f[i]+'">'+i+"</a></span>"}} if(e<a){b+='<span class="showpageNum"><a href="'+f[e+1]+'">'+pageNaviConf.nextText+"</a></span>"} if(endPage<a){b+='<span class="showpageNum"><a href="'+f[a]+'">'+pageNaviConf.lastText+"</a></span>"} document.write(b)};(function(){var b=location.href;if(b.indexOf("?q=")!=-1||b.indexOf(".html")!=-1){return}var d=b.indexOf("/search/label/")+14;if(d!=13){var c=b.indexOf("?"),a=(c==-1)?b.substring(d):b.substring(d,c);document.write('<script type="text/javascript" src="/feeds/posts/summary/-/'+a+'?alt=json-in-script&callback=pageNavi&max-results=99999"><\/script>')}else{document.write('<script type="text/javascript" src="/feeds/posts/summary?alt=json-in-script&callback=pageNavi&max-results=99999"><\/script>')}})(); //]]> </script> <div class='clear'/> </div> </b:includable>perPage: 7, numPages: 5
게시물 표시 개수와perPage
의 숫자는 같아야 합니다.
numPages
는 보여줄 최대 페이지 수입니다.
-
아래 코드를 찾습니다.
<b:include name='nextprev'/> -
3번 코드를 아래코드로 대체합니다.
<b:if cond='data:blog.pageType == "index"'> <b:include name='page-navi'/> <b:else/> <b:if cond='data:blog.pageType == "archive"'> <b:include name='page-navi'/> </b:if> <b:else/> <b:if cond='data:blog.pageType == "item"'> <b:include name='nextprev'/> </b:if> </b:if>
관련링크 : http://www.probloggertricks.com/2013/07/number-page-navigation-widget-for-blogger.html
구글 블로그 하단 페이지 네비게이션
Reviewed by jieun
on
오전 11:23
Rating:
댓글 없음: