Skip to main content

Home/ Groups/ WordPress Beginners
Toshiro Shimura

Wordpressウィジェットを使ってみる - Wordpress widgetsに関するメモ - uniluq memo - 0 views

  • Wordpressの「Widgets」は、もともと管理画面からサイドバーの表示内容を切り替えることの出来る便利なプラグインだったようですが、Wordpress2.5からは本体に組み込まれており、プラグイン導入の手順を踏まなくても利用できます。 早速独自テーマを選択し、管理画面のデザイン>ウィジェットからWidgetsを使ってみようとすると ウィジェットは使用できません 現在使用中のテーマはウィジェットに対応していないため、このままではサイドバーの変更はできません。ウィジェットに対応するようにテーマを修正するにはこちらの説明を参照してください。 と言われちゃいました。 デフォルトテーマのkubrickでは、設定無しに簡単に利用できるのですが、どうやら独自のテーマでこの機能を利用するためには、テーマファイルに少し手を加える必要があるようです。 でグーグルさんに聞きました。 超とりあえずWidgetsを使えるようにする! とりあえずWidgetsを使えるようにするには、「function.php」と「sidebar.php」を編集する必要があります。 function.php function.phpはテーマ内で使うユーザー関数など、全ページで呼び出したいプログラムをまとめて記述しておくファイルです。このファイルに <?php if ( function_exists('register_sidebar') ) { register_sidebar(); } ?> を加えます。ファイルが存在しない場合は新しく作ってください。 sidebar.php 標準のサイドバー部分のファイルです。このファイルの内容が例えば <ul>  <li>   <h3>このサイトについて</h3>   <div class="content">    このサイトは。。。。   </div>  </li> </ul> なら、これを <ul> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) { ?><!-- 追加 -->  <li>   <h3>このサイトについて</h3>   <div class="content">    このサイトは。。。。   </div>  </li> <?php } ?><!-- 追加 --> </ul> このように編集します。最初のULの後と、最後のULの前に1行ずつ加わりました。   ここまで終えて、再度デザイン>ウィジェットに行ってみると、Widgetsの管理画面を見ることが出来るようになっていて、管理画面でWidgetsの設定をすると、テーマに反映されるはずです。 ちなみに左サイドバー、右サイドバーというように、複数のサイドバーを使っている場合は、function.phpの内容を <?php if ( function_exists('register_sidebars') ) { register_sidebars(サイドバーの数); } ?> のように変更します。例(2個のバーを使う場合)↓ <?php if ( function_exists('register_sidebars') ) { register_sidebars(2); } ?> さらに、各サイドバーファイルの <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) { ?> の部分の「dynamic_sidebar()」という関数に <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) { ?> のように、数字の引数を与えてやると(ファイル毎に異なる数字)、複数バーのWidgetsを管理画面から管理出来るようになります。 以上とりあえず、Widgetsを使ってみるでした。
Toshiro Shimura

WP Super Cache と同居出来る様になったので Ktai Style を導入 at orioa - 0 views

  • うちのサイトは、Wp Super Cacheと、Wp Cache で動いてる箇所がバラバラで、不安定でした。完全に忘れてました。 ってことで、WP Super Cache と同居出来る ってのは 完全ではありません。
Toshiro Shimura

Rauru Blog » Blog Archive » WordPress 2.5 のフィード日付バグ - 0 views

  • 原因がようやくわかりました。2.5 系のバグです。記事をポストしたときに post_date_gmt フィールドに投稿時刻が入らず、0000-00-00 00:00:00 になってしまうという。そうすると puDate や publish 要素の値が大昔の日付になってしまって、フィードがめちゃくちゃなことになると。 wordpress.org のサポートフォーラムでも post_date_gmt is always 0000-00-00 として報告されてました。
  • しかしこのバグ、実は Trac でも再現できないという声が挙がってます。私もまだ中を詳しく負ったわけでは無いんですが、多分 XCache などのオブジェクトキャッシュを使っているときだけ顕在化するバグではないかと予想してます。サポートフォーラムでも This problem started showing up when I turned on XCache about a week ago という報告が出てますし。
Toshiro Shimura

メールフォームを追加するWordPressプラグイン | VIVABlog - 0 views

  • メールフォームのWordPress用プラグインは何種類かあったので手頃なものから試してみました。XREAのサーバーに設置しているサイトで実験したものです。 WP-ContactForm 日本語対応版 文字化け Secure Form Mailer Plugin 文字化け無し、本文が表示されない PXS Mail Form 正常動作 PXSMail with Akismet スパム対策版 というわけで・・・ PXS Mail Formを設置方法
Toshiro Shimura

記事のいろいろな情報をGetする。 | WordPressカスタマイズメモ【企業ホームページ制作方法】 - 0 views

  • WordPressはテンプレートタグを使うことで簡単にいろいろな情報を呼び出せるけど、もっといろんな呼び出し方がある。phpの関数を併用する場合などは、例えば記事の本文を呼び出す場合 the_content()を使う代わりに $post->post_contentという呼び出し方をすると、phpの関数の引数に放り込めるので、いろいろに加工できる。 ■記事の本文or抜粋を取得 $post->post_content$post->post_excerpt
Toshiro Shimura

WordPress Tip: Careful with that Autosave, Eugene * Perishable Press - 0 views

  • After upgrading WordPress from version 2.0.5 to 2.3.3, I did some experimenting with the “post autosave” feature. The autosave feature uses some crafty ajax to automagically save your post every 2 minutes (120 seconds by default). Below the post-editing field, you will notice a line of text that displays the time of the most recent autosave, similar to the following:
  • How to change the time-interval for the WordPress Autosave feature While experimenting with the autosave feature for this post, I discovered how easy it is to change the default autosave time interval. In WordPress 2.3 (and probably 2.2 and 2.1), open the wp-includes/script-loader.php and edit the instance of 120 (seconds) to something more appropriate. Don’t get too crazy though, or you might get a nasty email from your host. Here is how the interval-setting code appears on line #43: 'autosaveInterval' => apply_filters('autosave_interval', '120'),
Toshiro Shimura

How To Turning Off WordPress Autosave - Moonlight Blog - 0 views

  • I finally patched core program post_new.php to disable autosave for a “new” post and the problem went away. Do not know if this will help you or not. My patch for v.2.3.1 follows. Newer versions might be around the same location. Edit the file wp-admin/post_new.php WP v2.3.1 and insert “//” (without the quotes) at the beginning of this line (currently line 8): wp_enqueue_script('autosave'); Save and upload the file post_new.php, and the WordPress autosave features is now disable.
« First ‹ Previous 101 - 120 of 137 Next ›
Showing 20 items per page