Tagged: 404, child theme, example, page, theme
- This topic has 13 replies, 2 voices, and was last updated 10 years, 2 months ago by Theme Horse Support Team.
-
AuthorPosts
-
October 8, 2014 at 1:04 am #17226levi0322Participant
Hi,
I would like to know how I can create a new 404 error page, I have set up my clean retina child theme, but am unsure what to do next?I understand that I am to copy the 404.php into child theme, would like to know what to do here.
Also, when I look in the parent theme in 404.php and then look at the 404 error page, I don’t understand were the info is coming from, as there is nothing in 404.php for me to change.Any help would be appreciated, am still a newbie 🙂
thanking you in advance.October 8, 2014 at 11:02 pm #17266levi0322ParticipantI have scoured the internet and this forum for answers and I am still confused.
I am not sure about following the answers I have found in this forum, as they are not for the clean retina free version.
Please, I just want in steps, layman’s terms…. how to do this.October 9, 2014 at 11:58 am #17289Theme Horse Support TeamKeymasterhi levi0322,
We recommended not to change the code because if you change the code then while updating to our new version all your customisation code will be lost. So better make child theme and first unhook the functions and the edit the code.Example to customize the 404.php page
unhook functions // Unhook default Thematic functions function unhook_thematic_functions() { // Don't forget the position number if the original function has one remove_action( 'cleanretina_404_content', 'cleanretina_display_404_page_content', 10 ); } add_action('init','unhook_thematic_functions'); // removes the header content by using hook cleanretina_header add_action( 'cleanretina_404_content', 'cleanretina_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' ); ?></a></h1> </header> <div class="entry-content clearfix" > <p>Thank you</p> </div><!-- .entry-content --> </div><!-- #content --> <?php }
October 9, 2014 at 11:06 pm #17320levi0322ParticipantHi, I am not sure what you are trying to tell me here?
I copied this example and put it in a 404.php in child theme, is this right? Because when I check my 404 page it just looks the same and nothing has changed.
thanksOctober 10, 2014 at 1:59 pm #17354Theme Horse Support TeamKeymasterHi levi0322,
Yes exactly. Create a child theme folder (cleanretina_child) inside wp-content -> themes
create two file
1> style.css and import the css
2> functions.php
under function.php add the above code then when 404.php page is called it will display thank you. Because there is `<p>Thank you</p>
` You can use any text you want under it.Thank you!
October 10, 2014 at 10:24 pm #17380levi0322ParticipantHi, I created a functions.php and put in in my child theme, and nothing happened, so I went in and activated child theme to have a look and got an ‘internal error’ or something like that, so I had to go back and delete the functions.php from child.
Not sure what I am doing wrong here, or not understanding what you are telling me.
thanks.October 11, 2014 at 12:27 pm #17393Theme Horse Support TeamKeymasterHi levi0322,
We can’t create your child theme. We provide only the solution. If still you could not solve it then you may hire a developer to fix it.
Once read it more carefullyhttp://codex.wordpress.org/Child_Themes
Thank you!
October 12, 2014 at 10:38 pm #17431levi0322ParticipantI’m just gonna try one more time…. 🙂
I have created my child theme, that is not what I am asking, I am asking you if I was correct to put the above code into a functions.php and upload it to my child theme? Because I did this, and it didn’t work for me.Below is what I have used for the Child Theme, could you please, have a look at it and tell me if all good? As it seems to be working fine, and please, please tell me, if uploading the code to functions.php into theme is the right thing to do??
Thank you/*
Theme Name: Clean Retina Child
Theme URI: http://aging-naturally.com/clean-retina-child/
Description: Clean Retina Child Theme
Author: Pauline Downie
Author URI: http://aging-naturally.com
Template: clean-retina
Version: 1.0.0
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
Text Domain: clean-retina-child
*/
@import url(“../clean-retina/style.css”);/* =Theme customization starts here
————————————————————– */October 13, 2014 at 8:22 am #17448Theme Horse Support TeamKeymasterHi levi0322,
Yes this above code must be inside style.css/* Theme Name: Clean Retina Child Theme URI: http://aging-naturally.com/clean-retina-child/ Description: Clean Retina Child Theme Author: Pauline Downie Author URI: http://aging-naturally.com Template: clean-retina Version: 1.0.0 Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready Text Domain: clean-retina-child */ @import url(“../clean-retina/style.css”); /* =Theme customization starts here ————————————————————– */
After doing this this will import all the css from your parent theme
Regardless to page 404
Create one functions.php file
after this paste this codeunhook functions // Unhook default Thematic functions function unhook_thematic_functions() { // Don't forget the position number if the original function has one remove_action( 'cleanretina_404_content', 'cleanretina_display_404_page_content', 10 ); } add_action('init','unhook_thematic_functions'); add_action( 'cleanretina_404_content', 'cleanretina_child_display_404_page_content', 10 ); function cleanretina_child_display_404_page_content() { ?> <div id="content"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Error 404-Page NOT Found', 'attitude' ); ?></a></h1> </header> <div class="entry-content clearfix" > <p>Thank you</p> </div><!-- .entry-content --> </div><!-- #content --> <?php }
Make sure that you have created the child theme folder inside themes folder
Thank you!
October 16, 2014 at 10:57 pm #17623levi0322ParticipantHi, I will just run this past you one more time, then I think for sanity sake I just leave it alone….
I have put a functions.php in to my child theme with the above code, which is in the themes folder and nothing has happened, my 404 page still looks the same.
Is there something I am doing wrong??
Thank you 🙂
October 17, 2014 at 5:58 am #17635Theme Horse Support TeamKeymasterhi levi0322,
Just add this functions inside functions.php at the top of the page.<?php add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX); function enqueue_child_theme_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_uri(), array('parent-style') ); }
make sure that your child theme is created or not and from dashboard -> appearance -> themes
If yes then activate the child theme first. Once send you site url too. If still you are unable then you need to hire a developer. Because we don’t ask ftp. And from the dashboard only its not possible to customise the code.
Thank you!
October 17, 2014 at 9:41 am #17646levi0322ParticipantI’m sorry, I have no idea what you are trying to tell me! I really can’t understand what you are saying here!!
October 17, 2014 at 9:43 am #17647levi0322ParticipantAre you saying to add the above code, to the functions.php in child theme, and put it above the code you sent me earlier??
October 17, 2014 at 9:57 am #17649Theme Horse Support TeamKeymasterHi levi0322,
We don’t ask ftp so we can’t customise the code. So you need to hire a developer to fix it. We are sorry for this.
Can you send a child theme folder at [email protected]
We will look over it. Please while sending the email don’t forget to send this forum url too. You topic will be replied on monday only.Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.