ホーム > Wordpress関連

wordpressの検索結果ページをAutoPagerizeに対応させてみた


wordpress を AutoPagerize に対応させてみました。
テーマに、Vicuna を使っていると link-template.php ではなく Vicuna 内の修正が必要になります。
修正の詳細が知りたい方は Continue reading をクリックしてください。

参考
cocoa*life - AutoPagerizeに対応させました。
R405 - WordPress2.7にAutoPagerize導入(Vicuna)

$ cd /path/to/wp-content/themes/wp.vicuna.ext/ma38su-wp.vicuna-xxxxx/
$ svn diff
Index: search.php
===================================================================
--- search.php  (リビジョン 3)
+++ search.php  (作業コピー)
@@ -22,7 +22,7 @@
          the_post();
          $title = get_the_title();
 ?>
-      <div class="section entry">
+      <div class="section entry autopagerize_page_element">
          <h2><a href="<?php the_permalink() ?>"><?php echo $title; ?></a></h2>
          <ul class="info">
             <li class="date"><?php the_time(__('Y-m-d (D)', 'vicuna')) ?></li>
Index: functions.php
===================================================================
--- functions.php   (リビジョン 3)
+++ functions.php   (作業コピー)
@@ -327,6 +327,7 @@
    $nextpage = intval($paged) + 1;
 
    if(!is_single()) {
+        echo "$indentText<div class=\"autopagerize_insert_before\"></div>\n";
       if ($max_page> 1)
          echo "$indentText<ul class=\"flip pager\" id=\"flip2\">\n";
       if ($paged> 1) {
@@ -337,7 +338,7 @@
       if (empty($paged) || $nextpage <= $max_page) {
          echo "$indentText\t<li class=\"older\"><a href=\"";
          next_posts($max_page);
-         echo '">'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $next_label) ."</a></li>\n";
+         echo '" rel="next">'. preg_replace('/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $next_label) ."</a></li>\n";
       }
 
       if ($max_page> 1)
Index: tag.php
===================================================================
--- tag.php (リビジョン 3)
+++ tag.php (作業コピー)
@@ -20,7 +20,7 @@
       while (have_posts()) : the_post();
 ?>
 
-      <div class="section entry" id="entry<?php the_ID(); ?>">
+      <div class="section entry autopagerize_page_element" id="entry<?php the_ID(); ?>">
          <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
          <ul class="info">
             <li class="date"><?php the_time(__('Y-m-d (D)', 'vicuna')) ?></li>
Index: category.php
===================================================================
--- category.php    (リビジョン 3)
+++ category.php    (作業コピー)
@@ -25,7 +25,7 @@
          $title = get_the_title();
 ?>
 
-      <div class="section entry" id="entry<?php the_ID(); ?>">
+      <div class="section entry autopagerize_page_element" id="entry<?php the_ID(); ?>">
          <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
          <ul class="info">
             <li class="date"><?php the_time(__('Y-m-d (D)', 'vicuna')) ?></li>
Index: archive.php
===================================================================
--- archive.php (リビジョン 3)
+++ archive.php (作業コピー)
@@ -21,7 +21,7 @@
          $title = get_the_title();
 ?>
 
-      <div class="section entry" id="entry<?php the_ID(); ?>">
+      <div class="section entry autopagerize_page_element" id="entry<?php the_ID(); ?>">
          <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
          <ul class="info">
             <li class="date"><?php the_time(__('Y-m-d (D)', 'vicuna')) ?></li>

コメント:1

kyto 2009/01/12

参考にさせてもらいます、
ありがとうございました。

コメントフォーム
入力した情報を記憶する

トラックバック:0

この記事のトラックバック URL
http://www.sylvan-l.net/b/2009/01/10/%e6%a4%9c%e7%b4%a2%e7%b5%90%e6%9e%9c%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92autopagerize%e3%81%ab%e5%af%be%e5%bf%9c%e3%81%95%e3%81%9b%e3%81%a6%e3%81%bf%e3%81%9f/trackback/
トラックバックの送信元リスト
wordpressの検索結果ページをAutoPagerizeに対応させてみた - sylvan より

ホーム > Wordpress関連 > wordpressの検索結果ページをAutoPagerizeに対応させてみた

ぴくちゃー
ブログパーツ

ページの上部に戻る