theme development - I have Wordpress setup on primary domain, how do I set it up on its subdomain using the same database?

I have a site www.domain with Wordpress installed. I need to create a subdomain for testing a new theme and have it link

I have a site www.domain with Wordpress installed. I need to create a subdomain for testing a new theme and have it linked to the main site's database. I have manually added the Wordpress files into the subdomain and during the install in the browser I added the database info of the main site. However when I then try to complete the installation it tells me that I already have Wordpress installed and directs me to log into the main site. When I do so there is no option to view the subdomain.

How do I link the subdomain to the main site's database and have them work independently?

I have a site www.domain with Wordpress installed. I need to create a subdomain for testing a new theme and have it linked to the main site's database. I have manually added the Wordpress files into the subdomain and during the install in the browser I added the database info of the main site. However when I then try to complete the installation it tells me that I already have Wordpress installed and directs me to log into the main site. When I do so there is no option to view the subdomain.

How do I link the subdomain to the main site's database and have them work independently?

Share Improve this question asked Mar 30, 2019 at 2:07 NiallNiall 271 silver badge5 bronze badges 0
Add a comment  | 

3 Answers 3

Reset to default 0

Change the $table_prefix in the wp-config.php file.

But if you use the same database prefix on both sites, won't theme/plugin changes on the 2nd domain affect the first domain, since both are using the same database? (Theme and plugin settings are usually stored in the wp-options table of the database.)

I would set up a separate install of WP, then export from the 1st site to the 2nd site. That will give you content you can use as you play with themes and plugins. Once you get the themes and plugins working, you can export those (via an export/import plugin) from the 2nd site to the 1st site to get the theme/plugin settings into the 1st site.

If you just need to play with theme settings on the 2nd site, then there are some theme export/import plugins that work well to move the theme settings.

Don't do that. Let your testing site have its own database where you import a dump of your live site's database. Every environment is always supposed to have their own databases. If not, changes on the testing site would either affect the live site and/or raise the risk of FUBAR'ing your live site.

Consider Installing WordPress on your own Computer for that. Then download your live site's upload folder, plugins, themes and your lives site's database, and import your live site's database into the database on your own computer.

Then you can gamble around whatever you want. And if something's wrong, you can simply drop the database and import the live dump again.


Note that when importing your live database locally, you need to tell WordPress it got moved to another URL. So you simply could place the following three lines in your local wp-config.php. Where you replace http://mylocalurl.tld with the actual URL you access the local site on your computer.

define('RELOCATE', TRUE);
define('WP_HOME', 'http://mylocalurl.tld');
define('WP_SITEURL', 'http://mylocalurl.tld');

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745644526a4637890.html

相关推荐

  • 修改 win10 右键“新建”菜单(原理、两种方法及注意事项)

    修改 win10 右键“新建”菜单操作原理注意事项其他方法参考 修改 win10 右键“新建”菜单 这件事,基本上是新装系统之后必调校的一件事,每次都要搜索一下。但是网络上搜索到的答案&

    1小时前
    10
  • Windows网络重置后无法连接网络

    Windows网络重置后重启电脑无法连接到网络 打开命令提示符快捷键winR输入msconfig点击确定 在系统配置中找到服务先全部禁用,在全部启用,点击应用后重启电脑就可以了

    1小时前
    10
  • 更正

    之前文章 地表最强基准-ADR1001 中:这个地方有错误业界流量很高的号,百花潭也转载了,不改正的话变成了错误永流传。有读者留言说,恒温控制晶振(OCXO)也有类似的设计:对于某些应用,TCXO(温度补偿)的频率-温度稳定性指标仍无法满足

    1小时前
    10
  • JUC并发—6.AQS源码分析二

    大纲1.ReentractReadWriteLock的基本原理2.基于AQS实现的ReentractReadWriteLock3.ReentractReadWriteLock如何竞争写锁4.ReentractReadWriteLock如何竞

    1小时前
    10
  • 三代测序技术100问(2):PacBio 与 ONT,谁是你的长读长利器?

    在上一期(三代测序技术100问(1):NGS与第三代测序,如何做出明智选择?)中,我们厘清了二代与三代测序技术的适用边界,明确了选择需“因题施策”。然而,踏入三代测序的大门,新的抉择又摆在面前:目前市场上主流的长读长技术平台主要由两大阵营引

    1小时前
    00
  • Power BI 展示产品边际贡献

    SQLBI最近发布了一篇动态帕累托的文章,在帕累托曲线图表上增加图例,可以不对不同区域的客户贡献进行横向对比:来源 如果把X轴换成产品,该方案还可用来查看不同品类产品的边际贡献,进而对产品线规划进行改善。上图Computers Acces

    1小时前
    00
  • 重磅!TabPFN:小规模表格数据的革命性预测模型

       在生物医学、材料科学、经济学和气候科学等领域,表格数据(以行和列组织的电子表格)无处不在。传统上,梯度提升决策树(如XGBoost、CatBoost)在过去20年主导了表格数据的预测任务。然而,来自弗莱堡大学的研究团队近日在《Natu

    1小时前
    00
  • minio使用简介

    在云原生和微服务时代,对象存储已成为存储非结构化数据(如图片、日志、备份等)的首选方案。MinIO 是一款高性能、兼容 S3 API 的开源对象存储服务,而它的官方 Go SDK —— minio-go,则可以让你在 Go 语言项目中轻松集

    1小时前
    00
  • WIFI越近信号越强?CST电磁仿真看看

    在数字化浪潮席卷的现代社会,WiFi 早已深度融入日常生活与工作场景,成为不可或缺的关键要素。凭借便捷连接、高速传输的显著优势,WiFi 不仅重塑了人们的生活模式,还极大提升了工作效率。如今,无论是繁忙的办公室、温馨的餐厅,还是疾驰的交通工

    1小时前
    00
  • 告别复杂配置!中大型园区网络自动化开通流程实战解析

    到2025年,80%应用上云、30%流量为视频数据,传统网络无法支撑低时延、高可靠的云边协同需求。工业互联网场景中,TSN(时间敏感网络)等技术需网络架构深度重构以实现微秒级时延。传统园区网络的困境传统园区网络普遍存在部署周期长、管理复杂度

    1小时前
    00
  • 清华LeapLab开源cooragent框架:一句话构建您的本地智能体服务群

    本文由清华黄高教授团队完成,第一作者王政是清华 MEM 工程管理硕士,SeamLessAI 创始人,曾任爱奇艺虚拟机云平台负责人,小红书商业化算法工程团队负责人。刚刚,清华大模型团队 LeapLab 发布了一款面向 Agent 协作的开源框

    53分钟前
    00
  • DeepMind CEO 放话:未来十年赌上视觉智能,挑战 OpenAI 语言统治地位

    整理|冬梅、核子可乐去年成功斩获诺贝尔奖之后,Demis Hassabis 决定与一位国际象棋世界冠军打场扑克以示庆祝。Hassabis 一直痴迷于游戏,这股热情也成为他 AI 先驱之路上的契机与驱力。近日,做客一档名为《60 分钟》的访

    49分钟前
    00
  • Rust 现状全揭示:开发者生产力提升,信心却在下滑?

    作者 | Tim Anderson 译者 | Sambodhi 策划 | Tina图片2024 年 Rust 现状调查结果已经发布,显示生产力有所提升,但编译慢和调试困难仍然是重大挑战。另一个令人关注的问题是,尽管 Rust

    46分钟前
    00
  • .NET性能优化的10个关键教训:资深工程师的实战经验

    在作为高级软件工程师开发高规模.NET应用的十多年中,我亲历了众多性能挑战。有些经验来自深夜的生产事故,有些来自艰难的优化冲刺。以下是团队和我通过惨痛教训总结的十大最具影响力的性能优化实践。1. 异步等待误用的隐藏代价某订单处理微服务在高

    36分钟前
    00
  • 从0到精通,System.Text.Json进阶技巧曝光,性能提升3倍!

    一、引言在现代软件开发中,JSON(JavaScript Object Notation)作为一种轻量级的数据交换格式,被广泛应用于前后端交互、配置文件管理以及分布式系统间的数据传输。System.Text.Json 是 .NET Core

    34分钟前
    00
  • 华为将大规模推出AI芯片,助力替代英伟达H100,打破限制!

    据路透社昨日凌晨独家报道,华为预计最早将在5月份推出大量910C AI芯片,部分产品已经开始出货。此次华为发布的新产品主要是为了应对美国对国内AI芯片的限制,助力国内企业缓解AI芯片供应紧张的问题。值得注意的是,本月美国政府要求英伟达销售H

    27分钟前
    00
  • UML 2.0中的14种图简介

    UML(统一建模语言)2.0中定义了14种不同类型的图表,用于从不同角度描述系统。这些图表分为结构图和行为图两大类。可使用 PlantUML 绘制 UML 中的各种类型的图表: PlantUML是一个通用性很强的工具,可以快速、直接地创建

    19分钟前
    00
  • MVVMHabit

    过去属于死神,未来属于你自己。 ——英国谚语 MVVMHabit:基于 MVVM 的快速开发框架在 Android 开发中,架构设计是影响项目质量和维护成本的重要因素。为了帮助开发者快速构建高质量、易维护的应用,MVVMHabit 提供了

    15分钟前
    00
  • UNEXPECTED

    参考资料使用VMware安装Windows系统‌Media Creation Tool制作启动盘大白菜启动盘制作失败怎么办?大白菜纯净版启动盘制作教程(2025版)UltraISO 软碟通Windows系统启动速度如何设置屏幕分辨率使用微软

    5分钟前
    00
  • Windows实用设置工具,你想要的系统功能它都有!

    各位系统调校爱好者们注意啦!今天给大家安利一款装机必备的Windows实用工具包,堪称系统设置的"后悔药",操作系统的"美图秀"&am

    4分钟前
    00

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信