Child theme doesn't effect website
-
Hi,
I’m a bit of newbie to coding and everything but I’ve created a child theme and wanted to edit the footer (which I did successfully when I edited the parent theme so I know the coding is correct). I deleted the parent theme and reinstalled it because I found out the changes will get deleted when the theme gets updated.
I then created a footer.php file based on the parent footer.php file and made the changes to the child footer.php file. However these changes haven’t appeared on my site. I’m not certain that the coding for the child theme is set up correctly? Could one of you clever people on here possibly look at my coding for the child theme and footer and make sure everything is okay? And if it is, what can I do?
Please find codes below..
Thanks,
Tom.
STYLE.CSS
/*
Theme Name: Twenty Sixteen Child
Theme URI: http://tombretravel.com
Description: Twenty Sixteen Child Theme
Author: Tom Brewerton
Author URI: http://tombretravel.com
Template: twentysixteen
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: twenty-sixteen-child
*/FUNCTIONS:
<?php
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’ );
function theme_enqueue_styles() {
wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );}
?>
-
what changes have you made to footer.php?
what effect are you expecting?your site is using the child theme, so that is ok.
Hi Michael,Thanks for the quick reply. I wanted to get rid of ‘powered by wordpress’ and to add in a link to my disclaimer. Here is my edited version of the footer.php. I have made the changes on line 50-51 I think. I deleted the following:
<span class="site-title"><a>" rel="home"><?php bloginfo( 'name' ); ?></a></span> <a>"><?php printf( __( 'Proudly powered by %s', 'twentysixteen' ), 'WordPress' ); ?></a>And replaced it with:
<p>©2016 <a href="http://tombretravel.com">tombretravel</a></p> <a href="http://tombretravel.com/disclaimer/">Disclaimer</a>So in full, this is what my footer.php file looks like:
<?php /** * The template for displaying the footer * * Contains the closing of the #content div and all content after * * @package WordPress * @subpackage Twenty_Sixteen * @since Twenty Sixteen 1.0 */ ?> </div><!-- .site-content --> <footer id="colophon" class="site-footer" role="contentinfo"> <?php if ( has_nav_menu( 'primary' ) ) : ?> <nav class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Primary Menu', 'twentysixteen' ); ?>"> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'primary-menu', ) ); ?> </nav><!-- .main-navigation --> <?php endif; ?> <?php if ( has_nav_menu( 'social' ) ) : ?> <nav class="social-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Footer Social Links Menu', 'twentysixteen' ); ?>"> <?php wp_nav_menu( array( 'theme_location' => 'social', 'menu_class' => 'social-links-menu', 'depth' => 1, 'link_before' => '<span class="screen-reader-text">', 'link_after' => '</span>', ) ); ?> </nav><!-- .social-navigation --> <?php endif; ?> <div class="site-info"> <?php /** * Fires before the twentysixteen footer text for footer customization. * * @since Twenty Sixteen 1.0 */ do_action( 'twentysixteen_credits' ); ?> <p>©2016 <a href="http://tombretravel.com">tombretravel</a></p> <a href="http://tombretravel.com/disclaimer/">Disclaimer</a> </div><!-- .site-info --> </footer><!-- .site-footer --> </div><!-- .site-inner --> </div><!-- .site --> <?php wp_footer(); ?> </body> </html>Thanks for your help!
your site is running ‘WP-Super-Cache’
– have you made sure that the cache was cleared after the changes?I’ve cleared the cache both on my web browser and in the ‘wp super cache’ itself and still no joy. Is my coding correct? Or am I missing something really obvious?
Okay, I just made the same edit in the parent theme to double check my coding was correct and it is. This must mean that my child theme is not linking my footer.php file to the child theme?
So how do I get the child theme to use the customised child footer.php that I have created?
I have uploaded it via file zilla like I did with the child theme so I’m not too sure if the child theme is looking for the updated file?
Again, any help is hugely appreciated!
RESOLVED!
Apologies for all the comments! Basically, the child theme’s footer php file was called ‘footer-child-1.php’. I renamed it to footer.php and it solved my problem! Think wordpress didn’t like the file name!
So all sorted, thanks again for all the help Michael!
The topic ‘Child theme doesn't effect website’ is closed to new replies.