Comments (10)
Try using a different theme name, since wp_ is already used as a prefix.
from wprig.
Re-installing worked. I'm now up and running without errors. Thanks for your help!
-- Yvan
from wprig.
Fatal error: Cannot redeclare wp_scripts() (previously declared in C:\wamp64\www\wp\wp-includes\functions.wp-scripts.php:21) in C:\wamp64\www\wp\wp-content\themes\wp\functions.php on line 292
That error is telling you that you are attempting to redeclare the function wp_scripts
. That function exists in WordPress Core.
You have your theme named as wp
in the themes folder. I'm guessing that you are also using the prefix of wp_
. As @carolinan pointed out, you need to change your prefix to be something other than wp_
.
Notice that with WP Rig theme, it's prefixed as wprig_
. For you, give it a name that you want, some unique name for your theme.
from wprig.
I tried changing my theme folder name from "wp" to "yvan" .. then updated the theme name in my "themeConfig.js" file .. and then re-ran "npm install" and "npm run build" .. but I still get the same fatal error when I attempt to activate the theme:
Fatal error: Cannot redeclare wp_scripts() (previously declared in C:\wamp64\www\wp\wp-includes\functions.wp-scripts.php:21) in C:\wamp64\www\wp\wp-content\themes\yvan\functions.php on line 292
Is it really necessary that I re-install WordPress using a different table prefix?
- Yvan
from wprig.
A Little Background on the Error:
Look at the error. It's telling you that you have a function called wp_scripts()
on line 292 in your functions.php file. That function exists in WordPress Core. You need to rename the function to something else.
**Best practice is not to prefix using wp_
. **
How to fix?
You've already run npm run build
previously when your theme slug was wp
. During that build process, it renamed everything to start with that prefix.
How do you fix that? Well, after changing the themeConfig.js
file, you'll need to re-run npm run build
. But hold on. By doing so, it does not rename all of the functions in the PHP files. Hmm.
@ygagnon To get going, you'll need to delete the generated theme PHP files. Then re-run npm run build
.
from wprig.
I'll create a new issue to deal with re-running npm run build
and rebuilding the PHP files.
from wprig.
Deleting all of the generated PHP files and re-running "spm run build" allowed me to activate the wprig theme without errors .. but now the front end of the site is throwing errors .. almost as though there are some other non-PHP files that I also need to delete:
Fatal error: Uncaught Error: Call to undefined function yvan_is_amp() in C:\wamp64\www\wp\wp-content\themes\yvan\header.php:20 Stack trace: #0 C:\wamp64\www\wp\wp-includes\template.php(688): require_once() #1 C:\wamp64\www\wp\wp-includes\template.php(647): load_template('C:\wamp64\www\w...', true) #2 C:\wamp64\www\wp\wp-includes\general-template.php(41): locate_template(Array, true) #3 C:\wamp64\www\wp\wp-content\themes\yvan\index.php(15): get_header() #4 C:\wamp64\www\wp\wp-includes\template-loader.php(74): include('C:\wamp64\www\w...') #5 C:\wamp64\www\wp\wp-blog-header.php(19): require_once('C:\wamp64\www\w...') #6 C:\wamp64\www\wp\index.php(17): require('C:\wamp64\www\w...') #7 {main} thrown in C:\wamp64\www\wp\wp-content\themes\yvan\header.php on line 20
from wprig.
I'm going to try deleting all files and re-installing the github package. I'll report back afterwards.
- Yvan
from wprig.
@ygagnon Good idea. Delete the folder. Clone it again. Start over. Let's see if the problem goes away.
from wprig.
Yippee!! Thanks for your patience, @ygagnon. You can go ahead and close this issue since it's resolved for you.
BTW I did open a new issue for discussing the ability to regenerate/rebuild PHP files after running the build.
from wprig.
Related Issues (20)
- Default Font Color on Colored background gutenberg cover HOT 2
- theme.json HOT 1
- Can't extend any core classes HOT 2
- Integrate Theme.Json into WP-Rig HOT 2
- Bug blank page editor with 5.9 .. HOT 4
- Styles task hangs and never seems to complete HOT 1
- Inline SVG undefined properties HOT 1
- Change out colors to use block theme colors HOT 4
- Mobile menu obscures content when toggled off HOT 2
- Running production version changes part of string to 'undefined' HOT 3
- Update Deprecated Node Modules HOT 5
- Help instalation HOT 25
- PHP Fatal error on fresh install (`WP_Rig\WP_Rig\JavaScript\Component`) HOT 1
- Why is it so hard (read impossible) to change the color of the mobile menu toggle? HOT 1
- Upgrade Babel and eslint
- I installed but it stays in scripts HOT 3
- watch process freezes after "Finished 'editorStyles'.... " HOT 2
- mobile menu clickable under text when hamburger menu is folded up HOT 4
- Seemingly incomplete collapsible sub menu items feature in mobile nav
- Use intersection observer to swap the submenu direction so items do not go offscreen
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wprig.