Wordpress bloginfo('stylesheet_url')的值是保存在哪里? [英] Where is the value for Wordpress bloginfo('stylesheet_url') saved?

查看:556
本文介绍了Wordpress bloginfo('stylesheet_url')的值是保存在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设置了一个Wordpress网站(作为新手)。它的工作方式是,我有一个开发服务器上的安装,我改变的东西,然后有人把我的更改到活动服务器。



现在我来了跨越的问题,虽然一切工作正常在开发服务器,活动服务器不拉正确的CSS样式表。在HTML文件的< head> 中,我可以看到两个指向样式表的链接,并且都指向开发服务器URL ,而不是活动服务器网址



如果我没有错误,此信息将从 bloginfo('stylesheet_url')



现在我没有线索这个值来自哪里。我搜索了实时安装中的每一个文件,并且可以不是找到任何硬编码的链接(除了我会记住已经设置了硬编码的链接)。



解决方案

如果您要将数据库从本地移动到实时 - 或从任何域移动到另一个 - 您需要更改数据库中的URL。另请参阅移动WordPress«WordPress Codex



您可以使用phpmyadmin中的这些查询来更改URL:

  UPDATE wp_options SET option_value = replace(option_value,'http:// olddomain。 com','http://newdomain.com')WHERE option_name ='home'OR option_name ='siteurl'; 

UPDATE wp_posts SET guid = replace(guid,'http://olddomain.com','http://newdomain.com');

UPDATE wp_posts SET post_content = replace(post_content,'http://olddomain.com','http://newdomain.com');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://olddomain.com','http://newdomain.com');

更好的方法(answer 8/01 /使用 https://interconnectit.com/products/search-and-replace -for-wordpress-databases / ,它正确地处理数据库中的序列化数据; SQL查询将破坏序列化数据,并且您可能会失去一些主题和ohter选项作为结果。该脚本在 http://codex.wordpress.org/Moving_WordPress 食典页面上推荐。


I'm setting up a Wordpress site (as a newbie). The way it works is that I have an installation on a development server where I change stuff and then someone else moves my changes to the live server.

Now I've come across the problem that while everything works fine on the dev server, the live server doesn't pull the correct CSS stylesheets. In the <head> of the HTML file I can see two links to the stylesheet, and both point to the development server URL rather than the live server URL.

If I'm not mistaken, this info is pulled from bloginfo('stylesheet_url').

Now I have no clue where the value for this comes from. I've searched every single file in the live installation and could not find any hardcoded links (apart from that I'd have remembered to have set up hardcoded links).

Where then is this value saved?

Many thanks in advance!

解决方案

If you're going to move databases from local to live - or from any domain to another - you need to change URLs in the database. Also see Moving WordPress « WordPress Codex

You can use these queries in phpmyadmin to change URLs:

UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');

UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');

UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');

A better method (answer updated 8/01/2014) is to use https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ , which correctly deals with serialized data in the database; the SQL queries abov will break serialied data, and you may lose some theme and ohter options as a result. That script is recommened on the http://codex.wordpress.org/Moving_WordPress Codex page.

这篇关于Wordpress bloginfo('stylesheet_url')的值是保存在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆