- This topic has 3 replies, 2 voices, and was last updated 9 years, 11 months ago by
Theme Horse Support Team.
-
AuthorPosts
-
May 6, 2015 at 5:16 am #24668
Theme Horse Support Team
KeymasterHi aaron1,
This is an example how to unhook page 404.php and use your own content.
unhook functions
// Unhook default Thematic functions function unhook_thematic_functions() { // Don't forget the position number if the original function has one remove_action( 'attitude_404_content', 'attitude_display_404_page_content', 10 ); } add_action('init','unhook_thematic_functions'); // removes the header content by using hook attitude_header add_action( 'attitude_404_content', 'attitude_child_display_404_page_content', 10 ); /** * function to show the footer info, copyright information */ function attitude_child_display_404_page_content() { ?> <div id="content"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Error 404-Page NOT Found', 'attitude' ); ?></h1> </header> <div class="entry-content clearfix" > <p>Thank you</p> </div><!-- .entry-content --> </div><!-- #content --> <?php }
You need to do the same in your child theme. Create a style.css file and functions.php file and unhook the functions.
http://codex.wordpress.org/Child_ThemesIf you are unable to unhook then you need to hire a developer to fix it.
Thank you!
May 6, 2015 at 5:33 am #24670aaron1
ParticipantHi,
I appreciate the suggestions on the 404 page, but that’s not related to the specific problem I’m having.
My child theme has a stylesheet and functions.php. I’ve added several functions to the latter, which are working fine. However, I’m having trouble unhooking the Google fonts function.
I see that the parent theme’s function.php file is running a function called attitude_scripts_styles_method() and that this function is first registering the style ‘google-fonts’ and then enqueuing it. I’ve tried creating a function in the child functions.php file to deregister google-fonts, dequeue, or both, both as separate functions and together, but none of them are working.
I was able to do this successfully on another site with a different theme, but that theme handled the Google fonts hook differently (it had an individual function to register and enqueue that style, rather than doing that as part of another function), so it was easier to unhook. I sort of grasp the basics here, but I’m not a developer, so the structure of this specific function is confounding me.
May 7, 2015 at 4:44 am #24710Theme Horse Support Team
KeymasterHi aaron1,
Use
function unhook_thematic_functions() { add_action( 'wp_enqueue_scripts', 'attitude_scripts_styles_method' ); }
after this
add_action( 'wp_enqueue_scripts', 'attitude_child_scripts_styles_method'); function attitude_child_scripts_styles_method(){ // your stuff }
Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.