doulao2916 2015-02-26 02:40
浏览 203

高级自定义字段,Yoast SEO,不更新WordPress中的新值

I have a problem: Every time I make changes to the SEO fields, the ACF fields, and Multiple content blocks on pages and try to click update, they won't save (Basically, fields that are added through customisations).

DETAILS:

  • I am just starting on making a theme, based on the starkers theme Blank slate (https://github.com/viewportindustries/starkers) and haven't gone that far yet.
  • I am running on Localhost via easyPHP
  • This problem is mostly Prevalent to Pages not posts (Posts save SEO details, thankfully).
  • Changes to the Body content for pages still save.
  • I am suspecting it's something bad I did or something I haven't included yet on my functions.php file--- if there are any PHP experts here that could take a look, please, I'm begging your help. The functions.php code is just below:
  • Workaround: For ACF (Custom Fields) Entering Custom fields details on the generic WP custom field works (which isolates the problem on customisations on the theme). BUT this does not help the problem with WP SEO.
  • Workaround: For WP SEO, I had to change to another theme (premium theme, Batakoo) edit the SEO, and the SEO saves just fine. Switching back to the theme I was building, the SEO fields become read-only again.
  • I can't live on workarounds forever, I need fixes, so if anyone can help, please do.

THINGS THAT I'VE TRIED

Just to make sure we're on the same page and no one has to comment solutions that I've tried, here are the things I've already tried (but did not work) based on searching WP.Org for solutions to "Fields don't save on WordPress Pages":

  • I've had the database tables repaired via PhpMyAdmin
  • Removed extra spaces and additional comments in functions.php
  • disabled all plugins except the ones I'm testing (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条回答 默认 最新

  • dougou8552 2015-04-10 03:01
    关注

    Nevermind... found it all out when I tested regular pages other than the front page. It seems to be having a problem with the way WordPress checks static page for a front page by using a "home.php".

    评论

报告相同问题?

悬赏问题

  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算