转到Wordpress中的另一页时,标题中的图像不显示

时间:2019-03-26 04:24:37

标签: php html wordpress

我的标题首页上有带有site_url的徽标图像,但是当我移到另一页时,带有Image的标题是错误的,但是链接仍然有效。我检查了检查主页,该主页显示图像链接为“ xxx.local / xx.png,但我检查了另一个页面中的检查,显示图像链接为xxx.local / about / xx.png。

gunicorn --bind 0.0.0.0:8000 core.wsgi:application
[2019-03-26 10:55:16 +0000] [8560] [INFO] Starting gunicorn 19.9.0
[2019-03-26 10:55:16 +0000] [8560] [INFO] Listening at: http://0.0.0.0:8000 (8560)
[2019-03-26 10:55:16 +0000] [8560] [INFO] Using worker: sync
[2019-03-26 10:55:16 +0000] [8565] [INFO] Booting worker with pid: 8565
[2019-03-26 10:55:16 +0000] [8565] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker                                                                                                        
    worker.init_process()
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/gunicorn/workers/base.py", line 129, in init_process                                                                                                   
    self.load_wsgi()
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi                                                                                                      
    self.wsgi = self.app.wsgi()
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp                                                                                                     
    return util.import_app(self.app_uri)
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/gunicorn/util.py", line 350, in import_app
    __import__(module)
  File "/home/rofi/demo.protek/core/core/wsgi.py", line 16, in <module>
    application = WSGIHandler()
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 151, in __init__                                                                                                   
    self.load_middleware()
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/core/handlers/base.py", line 80, in load_middleware                                                                                             
    middleware = import_string(middleware_path)
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/utils/module_loading.py", line 20, in import_string                                                                                             
    module = import_module(module_path)
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/contrib/auth/middleware.py", line 4, in <module>                                                                                                
    from django.contrib.auth.backends import RemoteUserBackend
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/contrib/auth/backends.py", line 4, in <module>                                                                                                  
    from django.contrib.auth.models import Permission
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/contrib/auth/models.py", line 4, in <module>                                                                                                    
    from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/contrib/auth/base_user.py", line 52, in <module>                                                                                                
    class AbstractBaseUser(models.Model):
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/db/models/base.py", line 110, in __new__                                                                                                        
    app_config = apps.get_containing_app_config(module)
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/apps/registry.py", line 247, in get_containing_app_config                                                                                       
    self.check_apps_ready()
  File "/home/rofi/demo.protek/lib/python2.7/site-packages/django/apps/registry.py", line 125, in check_apps_ready                                                                                                
    raise AppRegistryNotReady("Apps aren't loaded yet.")
AppRegistryNotReady: Apps aren't loaded yet.
[2019-03-26 10:55:16 +0000] [8565] [INFO] Worker exiting (pid: 8565)
[2019-03-26 10:55:16 +0000] [8560] [INFO] Shutting down: Master
[2019-03-26 10:55:16 +0000] [8560] [INFO] Reason: Worker failed to boot.

1 个答案:

答案 0 :(得分:0)

将此代码添加到您的功能文件中。

register_default_headers( array(
'default-image' => array(
    'url'           => get_stylesheet_directory_uri() . '/assets/img/default-header.jpg',
    'thumbnail_url' => get_stylesheet_directory_uri() . '/assets/img/default-header.jpg',
    'description'   => __( 'Default Header Image', 'textdomain' )
),
) );

尝试上传您的图片。 有关更多详细信息,请参见此https://codex.wordpress.org/Function_Reference/register_default_headers