前提・実現したいこと
ワードプレスのPHPについて質問お願いします。
Parse error: syntax error, unexpected 'デスクトップの時のみ' (T_STRING) in /home/i-machinavi/blog-king.com/public_html/wp-content/themes/jstork/functions.php on line 4
と画面表示されています。
どこを修正したらいいかわかりましたら教えてくださいお願いいたします。
発生している問題・エラーメッセージ
Parse error: syntax error, unexpected 'デスクトップの時のみ' (T_STRING) in /home/i-machinavi/blog-king.com/public_html/wp-content/themes/jstork/functions.php on line 4
該当のソースコード
<?php
/**
- Twenty Fifteen functions and definitions
- Set up the theme and provides some helper functions, which are used in the
- theme as custom template tags. Others are attached to action and filter
- hooks in WordPress to change core functionality.
- When using a child theme you can override certain functions (those wrapped
- in a function_exists() call) by defining them first in your child theme's
- functions.php file. The child theme's functions.php file is included before
- the parent theme's file, so the child theme functions would be used.
- @link https://codex.wordpress.org/Theme_Development
- @link https://codex.wordpress.org/Child_Themes
- Functions that are not pluggable (not wrapped in function_exists()) are
- instead attached to a filter or action hook.
- For more information on hooks, actions, and filters,
- {@link https://codex.wordpress.org/Plugin_API}
- @package WordPress
- @subpackage Twenty_Fifteen
- @since Twenty Fifteen 1.0
*/
/**
- Set the content width based on the theme's design and stylesheet.
- @since Twenty Fifteen 1.0
*/
if ( ! isset( $content_width ) ) {
$content_width = 660;
}
/**
- Twenty Fifteen only works in WordPress 4.1 or later.
*/
if ( version_compare( $GLOBALS['wp_version'], '4.1-alpha', '<' ) ) {
require get_template_directory() . '/inc/back-compat.php';
}
if ( ! function_exists( 'twentyfifteen_setup' ) ) :
/**
- Sets up theme defaults and registers support for various WordPress features.
- Note that this function is hooked into the after_setup_theme hook, which
- runs before the init hook. The init hook is too late for some features, such
- as indicating support for post thumbnails.
- @since Twenty Fifteen 1.0
*/
function twentyfifteen_setup() {
/*
- Make theme available for translation.
- Translations can be filed at WordPress.org. See: https://translate.wordpress.org/projects/wp-themes/twentyfifteen
- If you're building a theme based on twentyfifteen, use a find and replace
- to change 'twentyfifteen' to the name of your theme in all the template files
*/
load_theme_textdomain( 'twentyfifteen' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
- Let WordPress manage the document title.
- By adding theme support, we declare that this theme does not use a
- hard-coded <title> tag in the document head, and expect WordPress to
- provide it for us.
*/
add_theme_support( 'title-tag' );
/*
- Enable support for Post Thumbnails on posts and pages.
- See: https://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
*/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 825, 510, true );
// This theme uses wp_nav_menu() in two locations.
register_nav_menus( array(
'primary' => ( 'Primary Menu', 'twentyfifteen' ),
'social' => ( 'Social Links Menu', 'twentyfifteen' ),
) );
/*
- Switch default core markup for search form, comment form, and comments
- to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'
) );
/*
- Enable support for Post Formats.
- See: https://codex.wordpress.org/Post_Formats
*/
add_theme_support( 'post-formats', array(
'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat'
) );
/*
- Enable support for custom logo.
- @since Twenty Fifteen 1.5
*/
add_theme_support( 'custom-logo', array(
'height' => 248,
'width' => 248,
'flex-height' => true,
) );
$color_scheme = twentyfifteen_get_color_scheme();
$default_color = trim( $color_scheme[0], '#' );
// Setup the WordPress core custom background feature.
/**
- Filter Twenty Fifteen custom-header support arguments.
- @since Twenty Fifteen 1.0
- @param array $args {
- An array of custom-header support arguments.
- @type string $default-color Default color of the header.
- @type string $default-attachment Default attachment of the header.
- }
*/
add_theme_support( 'custom-background', apply_filters( 'twentyfifteen_custom_background_args', array(
'default-color' => $default_color,
'default-attachment' => 'fixed',
) ) );
/*
- This theme styles the visual editor to resemble the theme style,
- specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'css/editor-style.css', 'genericons/genericons.css', twentyfifteen_fonts_url() ) );
// Indicate widget sidebars can use selective refresh in the Customizer.
add_theme_support( 'customize-selective-refresh-widgets' );
}
endif; // twentyfifteen_setup
add_action( 'after_setup_theme', 'twentyfifteen_setup' );
/**
- Register widget area.
- @since Twenty Fifteen 1.0
- @link https://codex.wordpress.org/Function_Reference/register_sidebar
*/
function twentyfifteen_widgets_init() {
register_sidebar( array(
'name' => ( 'Widget Area', 'twentyfifteen' ),
'id' => 'sidebar-1',
'description' => ( 'Add widgets here to appear in your sidebar.', 'twentyfifteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
}
add_action( 'widgets_init', 'twentyfifteen_widgets_init' );
if ( ! function_exists( 'twentyfifteen_fonts_url' ) ) :
/**
- Register Google fonts for Twenty Fifteen.
- @since Twenty Fifteen 1.0
- @return string Google fonts URL for the theme.
*/
function twentyfifteen_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = 'latin,latin-ext';
/*
- Translators: If there are characters in your language that are not supported
- by Noto Sans, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Noto Sans font: on or off', 'twentyfifteen' ) ) {
$fonts[] = 'Noto Sans:400italic,700italic,400,700';
}
/*
- Translators: If there are characters in your language that are not supported
- by Noto Serif, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Noto Serif font: on or off', 'twentyfifteen' ) ) {
$fonts[] = 'Noto Serif:400italic,700italic,400,700';
}
/*
- Translators: If there are characters in your language that are not supported
- by Inconsolata, translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Inconsolata font: on or off', 'twentyfifteen' ) ) {
$fonts[] = 'Inconsolata:400,700';
}
/*
- Translators: To add an additional character subset specific to your language,
- translate this to 'greek', 'cyrillic', 'devanagari' or 'vietnamese'. Do not translate into your own language.
*/
$subset = _x( 'no-subset', 'Add new subset (greek, cyrillic, devanagari, vietnamese)', 'twentyfifteen' );
if ( 'cyrillic' == $subset ) {
$subsets .= ',cyrillic,cyrillic-ext';
} elseif ( 'greek' == $subset ) {
$subsets .= ',greek,greek-ext';
} elseif ( 'devanagari' == $subset ) {
$subsets .= ',devanagari';
} elseif ( 'vietnamese' == $subset ) {
$subsets .= ',vietnamese';
}
if ( $fonts ) {
$fonts_url = add_query_arg( array(
'family' => urlencode( implode( '|', $fonts ) ),
'subset' => urlencode( $subsets ),
), 'https://fonts.googleapis.com/css' );
}
return $fonts_url;
}
endif;
/**
- JavaScript Detection.
- Adds a
js
class to the root<html>
element when JavaScript is detected. - @since Twenty Fifteen 1.1
*/
function twentyfifteen_javascript_detection() {
echo "<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>\n";
}
add_action( 'wp_head', 'twentyfifteen_javascript_detection', 0 );
/**
- Enqueue scripts and styles.
- @since Twenty Fifteen 1.0
*/
試したこと
wp-config.phpの中に書いてある
1
define('WP_DEBUG', false);
を
1
define('WP_DEBUG', true);
に変更しました。
補足情報(言語/FW/ツール等のバージョンなど)
wp-config.php
と
wp-config-sample.php
の両方しましたが変わらず画面が表示されません。
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
+1
エラーが出ているのは /home/i-machinavi/blog-king.com/public_html/wp-content/themes/jstork/functions.php ですが、別の functions.php を見ていませんか?
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
check解決した方法
-2
jstork/functions.phpを見つけて開いたら修正場所がわかりました。全く違うところを見ていたようです、色々親切に対応知ていただいてありがとうございます。
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.10%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
質問への追記・修正、ベストアンサー選択の依頼
Y.H.
2017/02/23 22:56
エラーメッセージどおりエラーは/home/i-machinavi/blog-king.com/public_html/wp-content/themes/jstork/functions.phpの4行目で出ているので/home/i-machinavi/blog-king.com/public_html/wp-content/themes/jstork/functions.phpの先頭から10行ほどを質問に記載すると回答を貰え安いと思います。今記載されているのは違うようです。
kotaro315
2017/02/23 23:08
間違えた箇所を記載していたみたいでした。返信ありがとうございます。 改めて更新しましたのでわかりましたら教えてくださいよろしくお願いします。
Y.H.
2017/02/23 23:12
これも違うようです。「デスクトップの時のみ」という文字列をソースファイルに記述した(または記述されているのを見た)記憶はありませんか?
kotaro315
2017/02/23 23:26
jstork/functions.phpを見つけて開いたら修正場所がわかりました。全く違うところを見ていたようです、色々親切に対応知ていただいてありがとうございます。