Whitelabel WordPress Theme - wordpress

How do I change a WordPress Theme name and keep it changed after an update? I have tried renaming the wp-content/themes/ folder, and the name inside the style.css file as well. However, the theme goes back to its original name after the update.
Perhaps there is a plugin that automatically overwrites the theme name and renames its folder to make it white label?
Steps that I have already done:
wp-content/themes/<renamed theme> - Changed theme name
Changed name inside theme's style.css file
Anything I can do to make the theme name automatically renamed even after the theme's automatic update (have to keep it due to security).

Change the name in the /themes/[renamed theme]/style.css
The line > Theme Name: [change it here]
If you update a theme via the WordPress admin it will overwrite all of its content. If you don't want it to update, try also changing the version to something really high in the style.css.
Example:
Version: 99.99
If you still want the renamed theme to update automatically it will always update all files. This can't be avoided.
Why not just use a child theme instead? https://developer.wordpress.org/themes/advanced-topics/child-themes/

Related

Can I change the theme name in WordPress?

How can I change the theme name in WordPress and where?
Can I also change the folder name theme1244 in public/wp-content/themes/theme1244 without having problems in the future?
Step 1: Firstly go to wp-content/themes/ folder. And then rename your theme folder to whatever you want.
Step 2: Open your theme folder and open style.css file. In top part of style.css you will see theme name. Rename it and save changes.
Step 3: Go to Wp-admin/appearance/themes and activate your theme under new name.
If you are using child/parent theme and you also rename parent theme folder&name, so after Step 3 you should additionally change parent theme path (template field) in child theme’s style.css.
note : renaming your theme will stop its automatic updates, you should do it manually in the future.
All the above is correct, but is not enough. After you rename the theme, e.g. rename the folder old-theme --> new-theme, you should copy the theme customizations (colors, header / footer, widgets, etc.) from the old theme to the new theme. This is done directly in the MySQL database:
Find an option named theme_mods_old-theme in the table wp_options
Copy the option_value (it is a text holding the theme customizations in a special WordPress format)
Put the copied value in a new option named theme_mods_new-theme in the wp_options table.
You can absolutely change the name of the folder without having any problems. If you want to change just the themes name, open the style.css in the root folder of your theme and edit the name in the comments at the top of the file. If you plan on doing more changes, you might be better off creating a child theme: https://codex.wordpress.org/Child_Themes
I changed my theme name in wp-content/themes/{your site name folder}/style.css
I am using a child theme
/*
Theme Name: WhateverYouWantToNameIT
Template: twentytwenty
*/
The answers above are good, but I wanted the full list and this is it
so go to: wp-content/themes/{your site name folder}/style.css
and change this values if they exist, if not you can add them
/* this should be at the top of your theme CSS file
Theme Name: Twenty Fifteen Child
Theme URI: http://example.com/twenty-fifteen-child/
Description: Twenty Fifteen Child Theme
Author: John Doe
Author URI: http://example.com
Template: twentyfifteen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: twentyfifteenchild
*/
See Source for more details
Its absolutely easy and simple, just follow instruction
1. Just rename theme name with your desire theme name.
2. open your desire theme name and open style.css file, and find theme name and changes with your desire theme name.
3. you can see your desire theme in admin dashboard-> appearance-> themes, just select and activate it.

Buddypress template hierarchy is not being used

I am updating an installation of buddypress (1.5) to the most recent version (2.1.1). I have updated the files and am now trying to update the theme to use the template hierarchy pattern.
For this I created the following directory structure within my theme:
my-theme/
buddypress/
groups/
index-directory.php
index-directory.php contains a single die('debug') statement for testing.
If I copy this buddypress directory into the twentyfourteen directory and activate that theme, I am seeing the debug message when I'm on the group listing page. However, when I use my custom theme, the message is not showing up.
This tells me that the template hierarchy is not being applied on my theme. Why could that be?
I suspect that somehow my theme is being treated as a legacy theme, I don't understand why though. I commented out the whole functions.php to make sure it's not because of aynthing in there. The header comment in the style.css does not contain anything special either.
Any help on this?
Thanks.
The problem was my own mistake. Our theme stylesheet had a Template: bp-default in it. I didn’t notice it at first because our theme is named similarly and my mind read it as the title of our theme. If I remove it, my templates are included.
For anyone stumbling on this problem in the future, here are the reasons why the template hierarchy could be deactivated by Buddypress:
Theme compat is disabled when a theme meets one of the following criteria:
1) It declares BP support with add_theme_support( 'buddypress' )
2) It is bp-default, or a child theme of bp-default
3) A legacy template is found at members/members-loop.php. This is a
fallback check for themes that were derived from bp-default, and have
not been updated for BP 1.7+; we make the assumption that any theme in
this category will have the members-loop.php template, and so use its
presence as an indicator that theme compatibility is not required
https://buddypress.org/support/topic/default-theme-is-still-showing/

Require another file before require file functions.php Wordpress

Same as title, i want require file 'foo.php' before wordpress require 'functions.php' in theme. What's solution? Somebody can help me?
Use a Child Theme.
Basically you just do this:
Create a directory in your themes directory to hold the child theme.
The theme directory is wp-content/themes. You should name the
directory without any space as part of the name, and it is common
practice to use the name of the parent theme folder with “-child”
appended to it. For example, if you are making a child of the
twentyfourteen theme, your folder name would be twentyfourteen-child.
Inside, you can create a functions.php and add the code you want, you can even call other files, like your foo.php:
(...) the functions.php of a child theme does not override its counterpart
from the parent. Instead, it is loaded in addition to the parent’s
functions.php. (Specifically, it is loaded right before the parent’s
file.)
You can also create a plugin, they are loaded before functions.php, you can take a look at the loading order here: https://wordpress.stackexchange.com/questions/26537/between-functions-php-widgets-and-plugins-which-is-loaded-first

Why is style.css breaking my custom Wordpress theme?

I have a clean install of WP 3.0.1, installed through cPanel and have created a directory for my new theme at /wp-content/themes/mytheme.
With an empty directory, the theme does not appear in the theme manager of the WP backend (as expected). If I add any PHP files (e.g. "page.php"), a warning appears in the theme manager that "mytheme" is broken because there is no style.css (again, as expected). But when I add style.css to the directory, the warning disappears and my theme is nowhere to be found in the theme manager. What's going on here?
Inside your style.css file you have to make sure that you are calling the default settings which wordpress will pick up, if you open up the default theme 'twentyten/style.css'
you will see this at the top..
/*
Theme Name: Twenty Ten
Theme URI: http://wordpress.org/
Description: The 2010 theme for WordPress is stylish, bla bla bla
Author: the WordPress team
Version: 1.1
Tags: black, blue, white, two-columns, fixed-width, etc..etc..etc..
*/
this has all the information wordpress needs inorder to include that theme in your appearence section.
once you have this inside your 'Mytheme' folder it will show up in the theme section, if you create a small png file called 'screenshot.png' add this inside your MyTheme folder, this will show up as the thumbnail for that theme... again look inside the twentyten folder and see how the files are arranged, this will give you a better understanding of how wordpress themes are built...
best thing to do while creating a new theme from scratch is possibly creating a copy of the twentyten folder and edit out all the un-required elements..
that gives you a good building block to work against.
or if you want there are a few themes out their which are naked themes, meaning they have the bearbones of what a theme needs then you can built upon..

Wordpress Broken Themes

In the WordPress 'Install Themes' option I have installed a theme called Facelook but after successful installation when I tried to activate it, following message appeared.
The following themes are installed but incomplete. Themes must have a
stylesheet and a template. Name: Facelook. Description: The parent
theme is missing. Please install the "bp-default" parent theme.
Where I can install bp-default? What does this error message mean?
Sounds like the "Facelook" theme is a child theme of the "bp-default" theme. You'll need to locate the bp-default theme and install it before you can use Facelook.
Check all uppercase/lowercase characters in the theme folder name match EXACTLY to the theme reference inside Style.css match.
Often when Wordpress complains that a theme is not installed (either when trying to use the theme, or when referencing the parent from a child-theme), it is because of an uppercase/lowercase mismatch.
For example:
inside style.css...
Template: supertemplate
is not the same as the folder name "Supertemplate"
Seems trivial, but something to check.

Resources