Page 1 of 1
WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 10:13 am
by simonmlewis
Hi
I have just been into a WordPress admin area, using Twenty Thirteen theme.
I needed to add some basic text to footer.php, so did it in the editor.
The moment I updated, the widgets and all styling from the footer in the site, disappeared, and all we have now is the Entries RSS stuff. No styling, no footer widgets.
I did backup the file, so put back the file into the folder, but it's had no effect.
What could have happened - I literally added about four words to the file within the </a> area of "proudly powered by".
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 10:17 am
by simonmlewis
Ok I updated the theme, and that cleared the problem. But how do you update that text int he footer:
"Proudly powered by WordPress"
Clearly it's not by altering footer.php!!!
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 10:59 am
by Celauran
Which bit specifically are you trying to edit? #secondary? .site-info?
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 11:03 am
by simonmlewis
within footer.php, I want to add to "proudly powered by wordpress".
I thought it would be in the Admin area, but it's in there within a .php file. But altering that screws it up.
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 11:07 am
by simonmlewis
It's within this code I need to add some text, just after the <a> tag for Word PRess.
I daren't do it now, in case it throws a wobbly again.
Code: Select all
<?php
/**
* The template for displaying the footer
*
* Contains footer content and the closing of the #main and #page div elements.
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
?>
</div><!-- #main -->
<footer id="colophon" class="site-footer" role="contentinfo">
<?php get_sidebar( 'main' ); ?>
<div class="site-info">
<?php do_action( 'twentythirteen_credits' ); ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentythirteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?></a>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 11:08 am
by Celauran
Can you post the changes you made or at least explain what you're trying to do? You can absolutely edit footer.php
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 11:12 am
by simonmlewis
Earlier on, I saw a bunch of other odd code in the footer file, but just added it like this...
Code: Select all
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentythirteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?></a> | <A href='domain here'>domain here</a>
Just the " | <A href='domain here'>domain here</a>" part.
Maybe it was corrupt before but still worked. IS this the only way to edit it?
I'm fearful because I've only just taken over this web site, and I already broke it! lol
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 11:17 am
by Celauran
I just made that exact change in a fresh WP install with 2013 theme and it's working fine.
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 11:22 am
by simonmlewis
Maybe it was a dodgy file then. As I say, there was a TON of crap at the top of the file.
I've zipped the file and attached it. The original.
Does the content explain why when I edited it, it completely lost it??
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 11:25 am
by Celauran
Without even yet having worked out exactly what that top line is doing, it looks dodgy. I'd definitely advise getting rid of that and checking through the rest of the codebase for other similar snippets. I'd guess the site was compromised at some point.
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 11:28 am
by simonmlewis
Well the theme has been updated, and all plugins updated.
The don't know anything about this kind of thing. The chap that did it,. doesn't really want to anymore, so I "bid" to look after it. And they accepted.
10 mins later, I break it! lol. But sounds like as you say, it was dodgy.
I think the logins needs altering fast!!
Re: WordPress Footer.php lost all widgets
Posted: Thu May 28, 2015 11:35 am
by simonmlewis
It worked. No problems.
Have told them passwords needs updating, as frankly they are stupidly easy!!!!