• Resolved shire_

    (@shire_)


    Hi there! First of all, thank you so much for creating Hemingway, it looks great.

    First question: How do I get the text “Home” at the top of the homepage to disappear? (but not necessarily every title on each page…just the homepage’s “Home”).

    Second question:
    I am having trouble getting the header image height taller. You see, I know that I can change the padding from 10% to something else (like posted in other posts) and it does enlarge it which is nice…but then in crops it. So basically I want to go into the functions.php and change the “416” to “550”. But every time I try to make a child page for functions.php my website says:

    Fatal error: Cannot redeclare hemingway_setup() (previously declared in /home/pinnspc/public_html/wp-content/themes/hemingway-child/functions.php:9) in /home/pinnspc/public_html/wp-content/themes/hemingway/functions.php on line 43

    Any ideas? I’ve made child pages before, and they’ve worked fine. But I still consider myself a newb, so I could be doing something wrong. And just to see if it would work, I went into the original functions.php and tweaked the numbers from 416 to 550, which I know is a “no no” but it did end up doing what I wanted it to do…so right now that is where my website is at. It looks how I want it currently (header wise anyway!) but I know that it could get messed up in the future because of updates, so I thought I’d ask if anyone had any tips on getting this child page up and running.

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • .

    (@techievous)

    First question: How do I get the text “Home” at the top of the homepage to disappear? (but not necessarily every title on each page…just the homepage’s “Home”).

    Could you please elaborate a bit? I’m not seeing any home button or link at the top.

    If you mean to hide a link on your navigation bar and only on home the page, you can use this:

    (if you’ve setup your nav location via Appearance –> Menus)

    .home #menu-item-68 { /* Change #menu-item-## to the correct number of your item; it'll be different for every site  */
        display: none;
    }

    (if you’re using the default, without setting up anything via Appearance –> Menus)

    .home .page-item-114 { /* Change .page-item-## to the correct number of your item; it'll be different for every site  */
        display:none;
    }

    Without seeing the site, I can’t tell which item-number it has. You’ll have to either provide us a link to your site or find it out on your own.

    ————–

    Second question:
    I am having trouble getting the header image height taller. You see, I know that I can change the padding from 10% to something else (like posted in other posts) and it does enlarge it which is nice…but then in crops it. So basically I want to go into the functions.php and change the “416” to “550”. But every time I try to make a child page for functions.php my website says:

    So . . . something like in this screenshot? Instead of teh default cropping 1280×416, you wish to change it to 1280×550, using the functions.php in your child theme. Is that correct?

    Try putting this into your functions.php, remove the <?php ?> tags if you already have something in place.

    <?php
    
    function hemingway_custom_header_setup() {
    	$header_args = array( 'height' => 550 );
    	add_theme_support( 'custom-header', $header_args );
    }
    add_action( 'after_setup_theme', 'hemingway_custom_header_setup' );
    
    ?>
    Thread Starter shire_

    (@shire_)

    Thank you Techievous for your prompt reply! And nope, actually not the navigation, sorry I should have clarified. It’s just the title text of the page (so whatever page you happen to be on…say “Home” or “About Us” it will have that same text at the top of the page of “Home” or “About Us”. You can see an example on https://wordpress.org/themes/hemingway where it says “Worth A Thousand Words” (only I suppose that is the name of the post in that case. But my homepage is a static page and it says “Home” there instead). I do like each page labeled that way for the other pages, but not the home page.

    Sadly, if i give you a link to the site you won’t be able to see it because it’s set to “Under Construction” without a login? I’m kind of afraid to take that setting off for too long because people are occasionally checking back to it, and I don’t want it to look incomplete.

    And so just to clarify, I don’t have to copy and paste the entirety of the functions.php code into the new child .php…only the section of code that I want to be different? Like for example just simply paste that code you listed there into a blank child functions.php and that is all?

    .

    (@techievous)

    You could do

    .home .post-title,
    .home .post-title a {
        display: none;
    }

    ————

    Only the new codes. If you actually copy the entire parent theme’s functions.php there, it would mess everything up.

    WordPress’s child theme functions.php doesn’t replace the parent theme’s functions.php; it loads in addition to the parent theme’s functions.php. The order is like this: child theme’s functions.php loads then parent theme’s functions.php loads.

    More info here: http://codex.wordpress.org/Child_Themes#Using_functions.php

    Thread Starter shire_

    (@shire_)

    Brilliant! Thank you so so much. Both of these fixes worked.

    Also, in case anyone is reading this post in the future and gets stuck…on something I almost got stuck on. I did the changes in the functions.php child file to 550. But no changes were taking effect…until I ALSO changed the header section padding to a higher percentage (almost forgot that part) in the style.css file. Like I said I’m a newb, so this may be obvious to most people but I thought I’d mention it just in case it’d help someone.

    So my padding (in the child style.css file) happens to need adjusting to about:

    .header.section { padding: 16% 0; }

    give or take.

    Thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Trouble creating a child functions.php, also how to remove the text "Home"?’ is closed to new replies.