ThemeAwesome / WP-Forge

WP-Forge - A Foundation for Sites WordPress Theme
https://themeawesome.com/wp-forge-wordpress-foundation-for-sites-theme/
85 stars 28 forks source link

Removing Customizer defaults #31

Closed creotip closed 9 years ago

creotip commented 9 years ago

Whats the easy way to do this?

tsquez commented 9 years ago

Hi Creotip,

That is a very good question. I am going to have to look into this and see how it can be done.

Is it for a child theme?

via my phone On Feb 8, 2015 6:00 AM, "creotip" notifications@github.com wrote:

Whats the easy way to do this?

— Reply to this email directly or view it on GitHub https://github.com/tsquez/wp-forge/issues/31.

creotip commented 9 years ago

Yes my friend. I need it clean as possible without defaults. I just commented out this line: require( get_template_directory() . '/inc/customizer/customizer.php' );

I think the results are good so far.

tsquez commented 9 years ago

Yes you could do that however if you update then you will have to do it again, when I get home I will see just exactly how to turn it off in the child theme

via my phone On Feb 8, 2015 11:47 AM, "creotip" notifications@github.com wrote:

Yes my friend. I need it clean as possible without defaults. I just commented out this line: require( get_template_directory() . '/inc/customizer/customizer.php' );

I think the results are good so far.

— Reply to this email directly or view it on GitHub https://github.com/tsquez/wp-forge/issues/31#issuecomment-73424870.

badcat commented 9 years ago

I've had this issue too - it's trying to find a happy medium of removing everything vs keeping some things that wold be useful from the Parent theme into the Child. I'm interested in seeing Thomas' solution.

FWIW, this plugin has also proven handy: Customizer Export/Import https://wordpress.org/plugins/customizer-export-import/

tsquez commented 9 years ago

Well you have to remember, the customizer is a function but it's not wrapped in a if function exists statement, this may happen in the next version, but you can still remove the function and pull in the customizer to the child them and rename the function, then you could add or remove items you don't want.

This is all theory mind you but I'm sure it can be done. I'll test this out later and see if it works :wink:

via my phone On Feb 8, 2015 1:22 PM, "BadCat Design" notifications@github.com wrote:

I've had this issue too - it's trying to find a happy medium of removing everything vs keeping some things that wold be useful from the Parent theme into the Child. I'm interested in seeing Thomas' solution.

FWIW, this plugin has also proven handy: Customizer Export/Import https://wordpress.org/plugins/customizer-export-import/

— Reply to this email directly or view it on GitHub https://github.com/tsquez/wp-forge/issues/31#issuecomment-73429505.

tsquez commented 9 years ago

My apologies guys, I didn't get chance to do this when I got home. My little one demanded my full attention, and rightly so, it seems Barbie and her friends had a scheduled fashion show and I was "hired on" as one of the judges (even though I was never notified and never signed and agreement that I would do the show...i didn't even get paid :expressionless: )

So before heading to work this morning I did a search and found this over on the WordPress forums https://wordpress.org/support/topic/removing-controls-and-settings-set-in-parent-from-child-theme - Seems this individual is/was trying to do the same thing. Check it out and see if it helps.

Hopefully today I can look into this later but I do have the new Walking Dead as well as Better Call Saul shows to watch, so I may not fully investigate until Tuesday.

tsquez commented 9 years ago

Sorry guys still haven't had the chance to sit down and review a solution. I haven't forgotten, I just want to try and find one that works and follows WordPress standards

szabeszg commented 9 years ago

Hi Thomas, +1 I use !important to override the rules baked in, but that is not a proper solution either (and I'm missing sass badly in these cases...). End user type clients should not be able to access the customizer anyway, except when we want them to ruin the design... Hope you can come up with a solution.

tsquez commented 9 years ago

A client can access anything they want, it is their theme and ultimately their site. You work for them not the other way around :wink: and besides if they go in and ruin something that should mean more $$$ for you.

tsquez commented 9 years ago

Wrote a tutorial for this http://themeawesome.com/remove-customizer-settings/ - Hope it helps :wink:

simkne commented 6 years ago

somwhow the latest update brought all the customizer settings back, and I can't seem to disable this anymore. I sue: / removing the customizer settings/ function remove_parent_customizer() { remove_action( 'customize_register', 'wpforge_customize_register' ); } add_action( 'after_setup_theme', 'remove_parent_customizer', 9 ); function remove_customizer_css() { remove_action('wp_head', 'wpforge_customize_css', 100); } add_action( 'after_setup_theme', 'remove_customizer_css', 9 );

tsquez commented 6 years ago

@simkne - Hi there

I didn't really do anything diff except remove a line of css that was causing the Off-Canvas menu to not be shown on mobile view.

The past few updates have been really simple as well. If you look at the changes from the past 4 to 5 versions, I haven't really done anything in the customizer or added anything.

I'll look into it and see what I can find for you. Sorry for the inconvenience.

tsquez commented 6 years ago

I see we discussed this a while back in post from 2015 (wow): https://themeawesome.com/remove-customizer-settings/. I just did a test using the code that Henk Barreveld suggested in the comments here and it works: function wpforge_customize_register() { return; } and function wpforge_customize_css() { return; }

try it out and let me know how it goes.