Community Forums › Forums › Archived Forums › Design Tips and Tricks › Customize Footer Metro Theme
- This topic has 22 replies, 7 voices, and was last updated 11 years, 12 months ago by
AnitaC.
-
AuthorPosts
-
February 15, 2013 at 11:01 pm #20633
Mike Gosling
ParticipantI have inserted the following css, which I found on Brian Gardner's site, into the Metro Functions file:
// Customize the entire footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'custom_footer' );
function custom_footer() {
?>
<p>© Copyright 2013 <a href="http://mydomain.com/">My Domain</a> · All Rights Reserved · Powered by <a href="http://wordpress.org/">WordPress</a> · <a href="http://mydomain.com/wp-admin">Admin</a></p>
<?php
}However, the footer appears at the bottom of the left content column, rather than in the footer of the website.
How do I get my footer text into my website footer?
Thanks,
Mike
Dr. Mike Gosling, The Emotional Leader Program
February 15, 2013 at 11:15 pm #20636WMcKinley
MemberHi,
I customized my footer by simply adding this to the functions.php file[CSS]
add_filter('genesis_footer_creds_text', 'custom_footer_creds_text');
function custom_footer_creds_text() {
echo "";
echo "Copyright © ", date("Y"), " YOURNAME.";
echo "";
}
[/CSS]I didn't need to do all that stuff you have above, just pasted that code in and it's good.
hope this show up ok, my first time answering a question
W. McKinley – PowerEmini.com
February 15, 2013 at 11:18 pm #20637WMcKinley
Memberlet me try it again to see if it shows up better
[PHP]
add_filter('genesis_footer_creds_text', 'custom_footer_creds_text');
function custom_footer_creds_text() {
echo "";
echo "Copyright © ", date("Y"), " YOURNAME";
echo "";
}
[/PHP]
W. McKinley – PowerEmini.com
February 16, 2013 at 7:22 pm #20750Mike Gosling
ParticipantThank you for your suggested code and appreciate your help.
But I need to retain the code I have with my affiliate link etc. The problem is where the code is appearing - currently at the bottom of the content section rather than in the footer section. There seems to be a hook missing that will place the code in the correct place and supercede the current footer code.
Dr. Mike Gosling, The Emotional Leader Program
February 16, 2013 at 10:55 pm #20776Derek
MemberFebruary 17, 2013 at 6:16 am #20787Mike Gosling
ParticipantWell I've tried every which way to get this to work, without success. All I get for my trouble is an ERROR:
Parse error: syntax error, unexpected '<' in /home/goslingm/public_html/wp-content/themes/metro/functions.php on line 163
So in the absence of advice from StudioPress I'll abandon trying to get it right.
Dr. Mike Gosling, The Emotional Leader Program
February 17, 2013 at 7:25 am #20795RickD
ParticipantHey Mike,
I just had to do this same thing so I wrote a quick tutorial on it. It should help you get your footer customized the way you need it. Here's the link: http://www.wpsyntax.com/wordpress/customize-footer-metro-theme
-rick
-Rick R. Duncan
February 17, 2013 at 7:25 am #20796AnitaC
KeymasterMike, use FTP and copy over the original functions.php file to your theme folder. The site will return. Sometimes when you copy/paste code that someone provides on here - the apostrophes (') and quote (") do not appear properly. So you need to go back and type them in the correct way or copy/paste them in using Notepad first. If you still need help, please let me know. Don't give up yet.
Need help with customization or troubleshooting? Reach out to me.
February 17, 2013 at 8:20 am #20805Mike Gosling
ParticipantThank you Anitac - I was able to FTP the functions.php file and the site has returned to normal. I won't put anything there again until I'm sure it will work and not crash my site.
Below is the code I got from BrianGardner.com (Which runs on Metro - although I expect he has customized his site). Unfortunately Brian does not say where to place the code, so I put it into the functions.php file. But it does not seem to like the code.
Maybe it's the <?php? I've posted the code with the <?php and without it. Still the code appears in the content section and not the footer. Any ideas?
Thanks, Mike
=========
<?php
// Customize the return to top of page text
add_filter( 'genesis_footer_backtotop_text', 'custom_footer_backtotop_text' );
function custom_footer_backtotop_text($backtotop) {
$backtotop = '[[footer_backtotop text="Return to Top"]]';
return $backtotop;
}// Customize the credits
add_filter( 'genesis_footer_creds_text', 'custom_footer_creds_text' );
function custom_footer_creds_text() {
echo '<div class="creds"><p>';
echo 'Copyright © ';
echo date('Y');
echo ' · <a href="http://mydomain.com">My Custom Link</a> · Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
echo '</p></div>';
}// Customize the entire footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'custom_footer' );
function custom_footer() {
?>
<p>© Copyright 2013 <a href="http://mydomain.com/">My Domain</a> · All Rights Reserved · Powered by <a href="http://wordpress.org/">WordPress</a> · <a href="http://mydomain.com/wp-admin">Admin</a></p>
<?php
}
Dr. Mike Gosling, The Emotional Leader Program
February 17, 2013 at 8:21 am #20806Mike Gosling
ParticipantHey Rick, I've just seen your post above - I'll give it a try. Thanks, Mike
Dr. Mike Gosling, The Emotional Leader Program
February 17, 2013 at 8:43 am #20807RickD
ParticipantHey Mike,
If you need any additional help just let me know. Sometimes the functions.php file can test a person's sanity. One simple fat-finger mistake and the website goes kaput.
-rd
-Rick R. Duncan
February 17, 2013 at 9:53 am #20811Emma
ParticipantHi Rick, thank you!!! First I tried to widgetize the footer like you showed in the latter part of your post, which - as promised - made two new widgets show up in my widget page. However, the text boxes I placed in them didn't remove the original text. I don't know anything about php, so maybe I should have tried something else.
I left it for now, because I resorted to your first method and it works like a charm! No more need for the Simple Edit plugin 🙂
February 17, 2013 at 10:33 am #20814RickD
ParticipantHey Emma,
Happy to hear one of the solutions worked for you. I'm not sure why the second version didn't work properly. It's what I have running on a test website at http://www.rvaplaces.com. Even though I haven't styled the text it works properly. Maybe you had partial code from first part mixed with part two???
If you want to try again, I've zipped the contents of part 2. If you start from scratch it should work fine. http://www.wpsyntax.com/downloads/metro-theme-footer-widgetized.php.zip
-Rick R. Duncan
February 17, 2013 at 6:10 pm #20906Mike Gosling
ParticipantHi Rick,
Well I gave it a go. Pretty much followed your instructions to the T, but got a heap of garbage at the top of my editor page in WP. So I'll move on now to find someone who I can pay to fix it for me. Thanks, Mike
Here's the garbage I got when I added your code:
=======
// Add span class to widget headlines add_filter( 'widget_title', 'metro_widget_title' ); function metro_widget_title( $title ){ if( $title ) return sprintf('%s', $title ); } // Load Backstretch script and prepare images for loading add_action( 'wp_enqueue_scripts', 'metro_enqueue_scripts' ); function metro_enqueue_scripts() { // Load scripts only if custom background is being used if ( ! get_background_image() ) return; wp_enqueue_script( 'metro-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'metro-backstretch-set', get_bloginfo('stylesheet_directory').'/js/backstretch-set.js' , array( 'jquery', 'metro-backstretch' ), '1.0.0' ); wp_localize_script( 'metro-backstretch-set', 'BackStretchImg', array( 'src' => get_background_image() ) ); } // Register widget areas genesis_register_sidebar( array( 'id' => 'subnav-left', 'name' => __( 'Subnav - Left', 'metro' ), 'description' => __( 'This is the left side of the subnav section.', 'metro' ), ) ); genesis_register_sidebar( array( 'id' => 'home-top', 'name' => __( 'Home - Top', 'metro' ), 'description' => __( 'This is the top section of the homepage.', 'metro' ), ) ); genesis_register_sidebar( array( 'id' => 'home-middle-left', 'name' => __( 'Home - Middle Left', 'metro' ), 'description' => __( 'This is the middle left section of the homepage.', 'metro' ), ) ); genesis_register_sidebar( array( 'id' => 'home-middle-right', 'name' => __( 'Home - Middle Right', 'metro' ), 'description' => __( 'This is the middle right section of the homepage.', 'metro' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom', 'name' => __( 'Home - Bottom', 'metro' ), 'description' => __( 'This is the bottom section of the homepage.', 'metro' ), ) ); genesis_register_sidebar( array( 'id' => 'after-post', 'name' => __( 'After Post', 'metro' ), 'description' => __( 'This is the after post section.', 'metro' ), ) );
Dr. Mike Gosling, The Emotional Leader Program
February 17, 2013 at 6:49 pm #20915AnitaC
KeymasterMike, I am totally bewildered here. You can try this - http://my.studiopress.com/snippets/footer/ and you can also just install the Genesis Simple Edits - http://www.studiopress.com/plugins/simple-edits.
Need help with customization or troubleshooting? Reach out to me.
February 17, 2013 at 8:31 pm #20920JestersTear
ParticipantI was trying to help before realising that it's the forum hopelessly mangling code, instead of a specific mistake in the code itself. Will come back if I think of something useful!
Monica | jesterstear on twitter | monicaguerraleiria.com
February 17, 2013 at 9:15 pm #20922Derek
MemberJester use the php tags when posting code.
[*php]code stuff in here[/*php]Example without the * characters
<?php echo 'Hello World'; ?>
~’;’~
February 17, 2013 at 10:09 pm #20928Mike Gosling
ParticipantHi Anitac, Thank you for your suggestion. I placed this code from the snippets folder into the functions.php file:
/** Customize the entire footer */ remove_action( 'genesis_footer', 'genesis_do_footer' ); add_action( 'genesis_footer', 'custom_footer' ); function custom_footer() { ?> <p>© Copyright 2012 <a href="http://mydomain.com/">My Domain</a> · All Rights Reserved · Powered by <a href="http://wordpress.org/">WordPress</a> · <a href="http://mydomain.com/wp-admin">Admin</a></p> <?php }
What happens is the same as reported in my first post here. The footer appears in foot of the left column content section and not in the page footer. I have left it in my site for you to see. Please go to http://mikegosling.com. So it seems this snippet is insufficient for the Metro Theme.
Thanks, Mike
Dr. Mike Gosling, The Emotional Leader Program
February 18, 2013 at 5:18 am #20956RickD
ParticipantHey Mike,
The code I presented should have done the trick. I've used it on a second website since I originally posted the code. Feel free to send me an email at [email protected] and lets work something out to get your footer where it needs to be.
-rd
-Rick R. Duncan
February 18, 2013 at 6:41 am #20962AnitaC
KeymasterOkay, we are at two pages of this... Mike, go to my website and send me an email with your email address. I can help you remotely from here. We can hook up and I can take a look at what you have. I use Join.me and can take control of your computer from here. Looking forward to helping you out.
Need help with customization or troubleshooting? Reach out to me.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.