-1
私のテーマのPHP
ファイルでテンプレートを編集した後、変更を保存しました.HTTP 500エラーが発生した後、コードを貼り付けようとしています。正確に同じ場所では、まだエラーが返されています。コードを修正するための解決策は何ですか?ワードプレスサイトのPHPエラーテンプレートを編集した後のHTTPエラー500
CODE
function the_archive_title($before = '', $after = '') {
if (is_category()) {
$title = sprintf(__('Category: %s', 'tesseract'), single_cat_title('', false));
} elseif (is_tag()) {
$title = sprintf(__('Tag: %s', 'tesseract'), single_tag_title('', false));
} elseif (is_author()) {
$title = sprintf(__('Author: %s', 'tesseract'), '<span class="vcard">' . get_the_author() . '</span>');
}
} elseif (is_tag()) {
$title = sprintf(__('Tag: %s', 'tesseract'), single_tag_title('', false));
} elseif (is_author()) {
$title = sprintf(__('Author: %s', 'tesseract'), '<span class="vcard">' . get_the_author() . '</span>');
} elseif (is_year()) {
$title = sprintf(__('Year: %s', 'tesseract'), get_the_date(_x('Y', 'yearly archives date format', 'tesseract')));
} elseif (is_month()) {
$title = sprintf(__('Month: %s', 'tesseract'), get_the_date(_x('F Y', 'monthly archives date format', 'tesseract')));
} elseif (is_day()) {
$title = sprintf(__('Day: %s', 'tesseract'), get_the_date(_x('F j, Y', 'daily archives date format', 'tesseract')));
} elseif (is_tax('post_format', 'post-format-aside')) {
$title = _x('Asides', 'post format archive title', 'tesseract');
} elseif (is_tax('post_format', 'post-format-gallery')) {
$title = _x('Galleries', 'post format archive title', 'tesseract');
} elseif (is_tax('post_format', 'post-format-image')) {
$title = _x('Images', 'post format archive title', 'tesseract');
} elseif (is_tax('post_format', 'post-format-video')) {
$title = _x('Videos', 'post format archive title', 'tesseract');
} elseif (is_tax('post_format', 'post-format-quote')) {
$title = _x('Quotes', 'post format archive title', 'tesseract');
} elseif (is_tax('post_format', 'post-format-link')) {
$title = _x('Links', 'post format archive title', 'tesseract');
} elseif (is_tax('post_format', 'post-format-status')) {
$title = _x('Statuses', 'post format archive title', 'tesseract');
} elseif (is_tax('post_format', 'post-format-audio')) {
$title = _x('Audio', 'post format archive title', 'tesseract');
} elseif (is_tax('post_format', 'post-format-chat')) {
$title = _x('Chats', 'post format archive title', 'tesseract');
} elseif (is_post_type_archive()) {
$title = sprintf(__('Archives: %s', 'tesseract'), post_type_archive_title('', false));
} elseif (is_tax()) {
$tax = get_taxonomy(get_queried_object()->taxonomy);
/* translators: 1: Taxonomy singular name, 2: Current taxonomy term */
$title = sprintf(__('%1$s: %2$s', 'tesseract'), $tax->labels->singular_name, single_term_title('', false));
} else {
$title = __('Archives', 'tesseract');
}
500 Internal Server Errorとは、解析エラーや誤字がある可能性が高いことを意味します。エラーログ(使用しているサーバのタイプによっては/ var/log /ディレクトリにある可能性があります)をチェックしたり、 wp_config.phpの設定。 – hcheung
さて、サイト全体が壊れている可能性はありますか? – user8244486
あなたが投稿したものがあなたの関数全体であるなら、最後には '}'がありません。 – hcheung