How to Remove Footer from Home Page in Metric Theme

Community Forums Forums Design Tips and Tricks How to Remove Footer from Home Page in Metric Theme

This topic is: not resolved

This topic contains 14 replies, has 4 voices, and was last updated by  Bill Murray 1 year, 8 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #8218

    harooki2
    Participant
    Post count: 9

    I need to remove the footer (all four widgets) from my home page in the Metric theme. Can someone point me to a post or offer advice?

    #8221

    Brian Bourn
    Participant
    Post count: 98

    Add this to your theme’s home.php file near the end but above “genesis();”


    remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );


    Bourn Creative | bourncreative.com | Twitter

    #8228

    harooki2
    Participant
    Post count: 9

    I can’t find genesis(); anywhere in that file, so I don’t know where to put it. It doesn’t work putting it at the very bottom, but that’s all I’ve tried.

    #8233

    Bill Murray
    Participant
    Post count: 575

    @Brian – The Metric home page is controlled by home.php, which is for practical purposes, HTML.  Therefore, PHP has to be enclosed with start & end tags.

    @harooki2 – Try putting the line below after <?php genesis_home(); ?>, which should be line 2.

    <?php remove_action( ‘genesis_before_footer’, ‘genesis_footer_widget_areas’ ); ?>


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    #8234

    harooki2
    Participant
    Post count: 9

    Well, that didn’t work either. Wish I knew PHP :), I could save you guys a lot of time.

    #8271

    Bill Murray
    Participant
    Post count: 575

    Ok, it’s a little different on Metric because of the way footer widgets are added. Try adding this to your home.php:


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    #8378

    harooki2
    Participant
    Post count: 9

    Bill, I don’t see any code in your last message.

    #8380

    Bill Murray
    Participant
    Post count: 575

    Odd.  The forum stripped that out.  Here it is:

    <?php remove_action(‘genesis_before_footer’, ‘metric_include_footer_widgets’); ?>

    I tested that on my own Metric install, and it works.

    One note on this: Genesis child themes can make changes to where certain functions are called or named.  When you want to make changes or follow a tip from these forums, it’s a good idea to see if your child theme’s functions.php is having an effect on the thing you want to change.  Even if you don’t understand PHP, if you want to change footers and see some code with ‘footer’ in it in your functions.php, that’s a good hint that your fix has to take that into account.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    #8382

    harooki2
    Participant
    Post count: 9

    This didn’t work for me, either. I tested the code in my home.php at line 1, line 2, line 3, the line before the last line, and the last line. I cleared my cache before refreshing the page each time. I copied it exactly as you have it in your last message, including the beginning and ending tags.

    #8391

    Riavon
    Participant
    Post count: 95

    The Genesis gurus advise making changes to the functions.php file, rather than the home.php

    From the old forums, andrea_r suggests: “You can remove that widget area entirely by removing the declaration for it from the functions.php file. Look for the code that says footer-widgets and remove it.”

    SoZo instructs: “Delete this from functions.php:

    [php]// Add widgeted footer section
    add_action(‘genesis_before_footer’, ‘metric_include_footer_widgets’);
    function metric_include_footer_widgets() {
    require(CHILD_DIR.’/footer-widgeted.php’);
    } [/php]

    And Nick suggests:

    “Open the functions.php file and find where it has the action to add the footer widgets, and put a // in front of the add_action() line.

    Find this:
    [php]// Add widgeted footer section
    add_action(‘genesis_before_footer’, ‘metric_include_footer_widgets’);
    function metric_include_footer_widgets() {
    require(CHILD_DIR.’/footer-widgeted.php’);
    }[/php]

    Change it to this:
    [php]// Add widgeted footer section
    //add_action(‘genesis_before_footer’, ‘metric_include_footer_widgets’);
    function metric_include_footer_widgets() {
    require(CHILD_DIR.’/footer-widgeted.php’);
    } [/php]

    Hope this helps you.


    Twitter: @riavonentprises

    #8393

    Bill Murray
    Participant
    Post count: 575

    @riavon – Based on what the original poster asked for, that’s not good advice.  The code you included will remove the footer from all pages.  He said he only wants to remove it from his home page.  There’s nothing wrong or inefficient about modifying a child theme’s home.php to effect changes on the home page.  In fact, for home page changes, it’s more logical to make changes to home.php if the child theme already includes that template.

    If you found a statement to the contrary on the old forums, please post a link.  I suspect the statement was intended to apply to a specific question and wasn’t a hard-and-fast general rule.  The statements you quoted above were likely in response to a request that was different from the original poster’s request.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    #8395

    Riavon
    Participant
    Post count: 95

    Whoopsie. In my zealous desire to help, I overlooked that he says home page. My very deepest apologies to you Bill as well as to you harooki2. I am sure with all the expertise and highly knowledgeable participants on this forum, you will most assuredly find the answer you need. Good day, and good bye.


    Twitter: @riavonentprises

    #8405

    Bill Murray
    Participant
    Post count: 575

    No apology necessary.  “Good bye” sounds so final.  I hope you weren’t put off by my comments, because I didn’t intend that.  I’m sorry if it came across as harsh.  Harooki2 has had a couple of threads on changing his home page, and code that Brian and I had given him previously didn’t work, so I just wanted him to avoid going down a path that might cause him further frustration.

    If you stick around long enough, you’ll have plenty of good opportunities to tell me my advice is terrible :)


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    #8429

    Riavon
    Participant
    Post count: 95

    Thanks, Bill. I get frustrated when I don’t pay close enough attention. I do feel I owe an apology, since the advice I offered (though copied) wasn’t what he was asking for. Perhaps I can redeem myself. Will this help?

    From 3200 Creative. They say:

    “Add this block of code to your functions.php file:

    [php]add_action( ‘genesis_before’, ‘child_conditional_actions’ );
    function child_conditional_actions() {
    if( is_home() )
    remove_action( ‘genesis_before_footer’, ‘genesis_footer_widget_areas’ );
    } [/php]

    I’ve customized the appearance of home pages via home.php several times… adding/deleting widgets, etc. and I learned how to do it only by Googling tutorials, and of course, lots of trial and error. Sometimes we need to become amateur php coders (or at least copy/pasters) to get the results we want.

    Hopefully the tutorial link above puts harooki2 on the right path. Although, on an additional read-through of the thread, it appears that you (Bill) had already suggested the if(is_home() ) bit. I will gracefully bow out of this one, LOL! My strength is CSS, so probably will focus on helping with CSS issues.


    Twitter: @riavonentprises

    #8447

    Bill Murray
    Participant
    Post count: 575

    Don’t bow out.  The more contributions, the better.  We all learned by starting with no knowledge, so any effort to help point people in the right direction is a good approach. If the advice you give isn’t quite right, there are plenty of troublemakers to tell you where you went wrong. Just be sure to give it right back at them.

    Your latest block of code isn’t quite right.  It is a way to add that to functions.php because it uses the is_home() conditional.  But the remove action is wrong, because that’s not how Metric adds its footer widgets.  Metric is an older theme that adds footer widgets by an included script.  That’s why I said in an earlier post to always look at the functions.php to see what the child theme is modifying by default.  So in your code, replace genesis_footer_widget_areas with metric_include_footer_widgets and it should work in functions.php. For newer themes, as a general guideline your code would probably work without modification, but each child theme could change things in its own functions.php.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.