Php WordPress没有返回图像,而是返回false

Php WordPress没有返回图像,而是返回false,php,wordpress,Php,Wordpress,我的任务是为我们的客户解决wordpress网站的问题,除了代码中不显示背景图像的部分外,几乎所有的问题都得到了解决 我一直在我的本地计算机上进行修复,并从网上导入了所有数据。下面是我跟踪的代码 <?php $taxonomies = get_all_category_ids(); var_dump($taxonomies); $count = 1; foreach ($taxonomies as $cat_id) { $cats_id = intval($c

我的任务是为我们的客户解决wordpress网站的问题,除了代码中不显示背景图像的部分外,几乎所有的问题都得到了解决

我一直在我的本地计算机上进行修复,并从网上导入了所有数据。下面是我跟踪的代码

<?php
  $taxonomies = get_all_category_ids();
  var_dump($taxonomies);

  $count = 1;
  foreach ($taxonomies as $cat_id) {
    $cats_id   = intval($cat_id);
    var_dump($cats_id);

    $category  = get_category($cats_id);
    var_dump($category);

    $cat_meta  = get_option("category_$cats_id");
    $image_cat = get_option("category_$cats_id");
    var_dump($image_cat);

    if ($category->parent == 9) {
      $thumbnail_id   = get_term_meta( $cats_id, 'wpfifc_featured_image', true );
      $thumbnail_html = wp_get_attachment_url( $thumbnail_id, 'post-thumbnail' );
      $categ_slug     = $category->slug;
      $categ_name     = strtoupper($category->name);

      if ($categ_slug == 'all-day-breakfast'): ?>
        <div style="background-image:url(<?php echo $image_cat['img'];?>);background-size: 100%;" class="box_menu01 <?php echo $categ_slug?>" background>
          <span>
            <a href="<?php echo get_page_link(2) . "#" . $categ_slug; ?>"><?php echo $categ_name; ?></a>
          </span>
        </div>
      <?php else: ?>
        <div style="background-image:url(<?php echo $image_cat['img'] ?>);background-size: 100%;" class="box_menu02 <?php echo $categ_slug?>" background>
          <span><a href="<?php echo get_page_link(2) . "#" . $categ_slug; ?>"><?php echo $categ_name; ?></a></span>
        </div>
      <?php endif; ?>
      <?php $count++;
    }
  }
?>
零件应返回图像路径,因为该路径正在中使用

<div style="background-image:url(<?php echo $image_cat['img'];?>);background-size: 100%;" class="box_menu01 <?php echo $categ_slug?>" background>

什么是
类别\u$cats\u id

我认为代码应该是

$image_cat = get_option("category_".$cats_id."");

它在PHP中完全有效
$image_cat = get_option("category_$cats_id");
$image_cat = get_option("category_".$cats_id."");