我有一个问题:每次我更改SEO字段,ACF字段和页面上的多个内容块并尝试单击更新时,它们都不会保存(基本上是通过自定义添加的字段) .
细节:
-
我刚刚开始制作一个主题,基于starkers主题Blank slate(https://github.com/viewportindustries/starkers)并且还没有走得那么远 .
-
我通过easyPHP在Localhost上运行
-
这个问题主要是 Prevalent to Pages 不是帖子(帖子保存搜索引擎优化详情,谢天谢地) .
-
页面正文内容的更改仍然保存 .
-
我怀疑它还包含在我的functions.php文件中---如果这里有任何PHP专家可以看看,拜托,我求你帮忙 . functions.php代码如下:
-
Workaround :对于ACF(自定义字段)输入通用WP自定义字段的自定义字段详细信息(可以隔离主题上的自定义问题) . BUT 这对WP SEO没有帮助 .
-
Workaround :对于WP搜索引擎优化,我不得不改为另一个主题(高级主题,Batakoo)编辑搜索引擎优化,而SEO保存就好了 . 切换回我正在构建的主题,SEO字段再次变为只读 .
-
我不能永远活在变通办法上,我需要修复,所以如果有人可以提供帮助,请做 .
我试过的事情
只是为了确保我们在同一页面,没有人必须评论我尝试过的解决方案,这里是我已经尝试过的东西(但没有用),基于搜索WP.Org解决方案“Fields”不要保存在WordPress页面上:“
-
我已经通过PhpMyAdmin修复了数据库表
-
删除了functions.php中的额外空格和附加注释
-
禁用除我正在测试的所有插件(SEO)
<?php
require_once( 'external/starkers-utilities.php' );
/* Theme settings */
define('WT_DIR', get_template_directory_uri());
define('WT_TEMPLATE_DIR', get_template_directory());
add_theme_support('post-thumbnails');
register_nav_menus(array('wt-prime-menu' => 'Main Menu'));
function wt_nav() {
wp_nav_menu( array('theme_location'=> 'wt-prime-menu','container'=> false,'menu_class'=> 'nav navbar-nav navbar-right' ));
}
/* Actions and Filters */
add_action( 'wp_enqueue_scripts', 'starkers_script_enqueuer' );
add_filter( 'body_class', array( 'Starkers_Utilities', 'add_slug_to_body_class' ) );
/* Custom Post Types */
require_once( 'parts/cpt/cpt.php' );
/* Enqueue Scripts */
function starkers_script_enqueuer() {
wp_register_script( 'site', WT_DIR.'/js/site.js', array( 'jquery' ) );
wp_enqueue_script( 'site' );
wp_register_style( 'screen', get_stylesheet_directory_uri().'/style.css', '', '', 'screen' );
wp_enqueue_style( 'screen' );
}
function wt_scripts_and_styles() {
wp_enqueue_style( 'bootstrap', WT_DIR . '/css/bootstrap.min.css' );
wp_enqueue_style( 'whitetower', WT_DIR . '/css/wts.css' );
wp_enqueue_style( 'googlefonts', 'http://fonts.googleapis.com/css?family=Roboto:500,400|Raleway:600,900|Montserrat:400,700' );
wp_enqueue_script( 'bootstrap', WT_DIR . '/js/bootstrap.min.js', array(), '3.2.0', true );
wp_enqueue_script( 'wtnav', WT_DIR . '/js/snav.js', array(), '1.0.0', true );
wp_enqueue_script( 'flexslider', WT_DIR . '/js/flexslider.js', array(), '2.2.2', true );
wp_enqueue_script( 'modernizr', WT_DIR . '/js/modernizr.js', array(), '2.7.1', true );
wp_enqueue_script( 'googlefonts', WT_DIR . '/js/wt-webfonts.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'wt_scripts_and_styles' );
/* Comments */
function starkers_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
?>
<?php if ( $comment->comment_approved == '1' ): ?>
<li>
<article id="comment-<?php comment_ID() ?>">
<?php echo get_avatar( $comment ); ?>
<h4><?php comment_author_link() ?></h4>
<time><a href="#comment-<?php comment_ID() ?>" pubdate><?php comment_date() ?> at <?php comment_time() ?></a></time>
<?php comment_text() ?>
</article>
<?php
endif;
}
1 回答
没关系......当我测试除了首页以外的常规页面时,发现了这一切 . 似乎WordPress使用“home.php”检查首页的静态页面的方式有问题 .