You are currently browsing the archives for the WordPress category.

CoreServer で WordPress を使う時の .htaccess

09.06.08

CoreServer で モジュールモードで WordPress を使うとき、Permission のエラーが出る。その対処方法のメモ。

AddHandler application/x-httpd-phpcgi .php

を記述した .htaccess を置く場所

  • one click pluguins-updater を使用時は、そのプラグインフォルダに置く
  • ディレクトリー/wp-admin に置く(もっと絞り込めそうだが)

KtaiStyle の functions.php

09.06.08

KtaiStyle の functions.php は通常テーマの functions.php とはかぶらないらしいのか?
同じ定義関数を置いてみたが、エラーはなかったなかった。

表示設定>>フロントページの表示 の考察

09.06.07
  • フロントページで設定したページのスラッグ(パーマネントリンク)ではアクセスできなくなる。
  • 投稿ページで設定したページの内容は表示されない(themes-Defaultの場合)
    また、カテゴリをクリックすると、URLからそのページのスラッグはなくなる(WordPress標準のURLになる(〜/category/○○○○○))
  • 投稿ページで設定したページは themes の index.php を使うのか?

よくわからん。。。特に「投稿ページ」。

Codexに説明があった。やっぱし、ここで最初みないと
http://wpdocs.sourceforge.jp/Settings_Reading_SubPanel

  • A static page (select below) - Check this radio button to cause a “static” Page
    to be displayed as your blog’s front page. At the same time, choose the
    Page that will display your actual Posts. The Front page and Posts page
    cannot be the same value.

  • Front page - Select in the drop-down box the actual Page
    that you want displayed as your front page. If you do not select a
    choice here, then effectively your blog will show your posts on both
    the blog’s front page and on the Posts page you specify. If you would like to create a static home page template file, do not name it home.php,
    otherwise you will encounter problems when you try to view the
    “blog”/”posts” section of your site. To get around this, just name it
    anything but home.php, for example, myhome.php
    てきとーな訳)あなたのブログのフロントページになる、Pageを選んでね。ブログはフロントページと指定した投稿ページに現れます。ページテンプレートを作るときはhome.phpはやめてね。サイトのブログを表示するときに問題が発生するよ。例えばmyhome.phpくらいにしといてね。
  • Posts page - Select in the drop-down box the name of the Page
    that will now contain your Posts. If you do not select a Page here,
    your Posts will only be accessible via other navigation features such
    as category, calendar, or archive links.
    てきとーな訳)最新の投稿を表示するPageを選んでね。もし選ばなかったら、カテゴリ、カレンダー、アーカイブのリンクからでしかアクセスできないから。

以上を踏まえて考えると、投稿ページを設定したら、そいつはthemesのhome.phpを優先的に使うらしい。フロントページは優先的にpage.phpかな、ページテンプレートがなければね

子ページを取得

09.05.02

下記のような関数があるが、環境が複雑なせいか動かない。
プラグインとかなく、シンプルな条件ならどうなんだろうか?

Function Reference/get page children « WordPress Codex

Usage

<?php &get_page_children$page_id$pages ?>

<?php get_page_children$page_id$pages ?>



Parameters

$page_id
(integer) (required) Page ID.
Default: None

$pages
(array) (required) List of pages’ objects.
Default: None

Return Values

(array)

管理画面>投稿のカテゴリー欄を広くする

09.04.27

WordPress2.7.1

/wp-admin/wp-admin.cssを下記のところのheightを変更。

#categorydiv div.ui-tabs-panel,
#linkcategorydiv div.ui-tabs-panel {
    height: 250px;
    overflow: auto;
    padding: 0.5em 0.9em;
}

WordPress 投稿作成画面のカテゴリー表示を見やすくする - WordPress 研究室

カスタムフィールドの値の取得

09.04.26

カスタムフィールドの使い方 - WordPress Codex 日本語版

get_post_meta($post_id, $key, $single);

  • $post_id は、メタデータの値を取得する記事のIDです。 $post->ID を使って記事のIDを取得してください。
  • $key は取得するキーの文字列です。
  •   $single は true または false としてください。true に設定されている場合、結果を1つの文字列として返します。false の場合、カスタムフィールドの配列を返します。

カテゴリその2

09.04.25

カテゴリスラッグからIDへ、そして、子カテゴリ(ID)をゲット

$str = get_category_children( get_category_by_slug(’course’)->term_id );
$catChiIDarray = explode(’/',$str);

親カテゴリをゲット

echo(get_category_parents(category, display link, separator, nice name));

Codex参照

カテゴリ名からID変換など

09.04.25

ぼんずーず : wordpressのカテゴリー表示についてメモ

テーマファイルや管理画面でカテゴリーを取得する際によく使う関数をご紹介

1.カテゴリーが存在するか調べる

in_category(’カテゴリー名’)

で’カテゴリー名’のカテゴリーが存在するかどうかを真偽で返してくれます

2.カテゴリIDからカテゴリ名を取得する

get_the_category_by_ID(’カテゴリーID’)

3.カテゴリ名からカテゴリIDを取得する

いつから使えるか分からないけどwordpress2.5なら使えます

get_cat_ID(’カテゴリー名’) …カテゴリ名であって、スラッグではない。

検索結果の件数、投稿数の表示

09.04.25

検索結果の件数を表示【WordPressカスタマイズメモ】

●$wp_query->found_posts

●$XXX->post_count

wordpress TinyMCE の画像挿入のまとめ

09.04.24

タイトルはimgタグのtiltleへ行き、キャプションはaltとなる。しかし、キャプションの欄を入力するとキャプションタグが付いてしまう。

« Previous PageNext Page »