• Newb here.

    I’m putting together a site for a client and we want to remove “Home” from the homepage (directly under header).

    I’ve created a child theme (first time), so now in the editor is nothing except the style.css I created for the child theme.

    Anyway, how can I remove this? Here’s a link to the site:

    https://www.brokerinabox.net

    Thank you.

Viewing 14 replies - 1 through 14 (of 14 total)
  • You could duplicate in your theme folder the file content-page.php, but make a small change where the title is written.

    You could change in the beginning of the file from this:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<header class="entry-header">
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    		</header>

    to this:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<?php if(!is_front_page()): ?>
    		<header class="entry-header">
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    		</header>
    		<?php endif; ?>

    This template is what is used to generate the page, and you are showing the header just if the current page is not the frontpage.

    It may be easier to do it in the CSS — in which case, if you want the change only on the home page, add this to the new child theme style.css:

    body.home .entry-header {
        display: none;
    }

    If you want to remove that line on every page, change the above to:

    .entry-header {
        display: none;
    }

    Thread Starter ChiefGeek

    (@chiefgeek)

    thank you WPyogi, that code worked, and was easy even for a noob like me! ??

    i just deleted the 3rd line altogether

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<header class="entry-header">
    			<h1 class="entry-title"><?php the_title(); ?></h1>
    		</header>

    it’s now

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<header class="entry-header">
    
    		</header>

    it worked, not showing page name anymore.

    @dradutu – Make sure that you are not making any changes to theme files – they will be lost when WP is updated and it’s imperative that you have an unmodified copy of the default theme for troubleshooting purposes. To make changes, you should use a child theme:

    https://codex.www.ads-software.com/Child_Themes

    thanks, i keep txt versions of my modified css, but i’ll look into child themes, i know it’s the way to go. thank you!

    Costume

    (@costume)

    If I want to remove the page name from the About Us page and the Contact page but not the rest, then would my code be this…

    body.home .About Us .Contact .entry-header {
    display: none;
    }

    Thanks

    WPyogi

    (@wpyogi)

    No, that’s a logical guess, but those are not actually valid classes in the HTML for those pages – if you post a link to your site, someone can look for you – or look at the body tag on that page — and you’ll see the unique page id or class.

    Techno Tim

    (@techno-tim)

    Hiding with Css display:none; is meant to be a no no if over-used on a site.
    If you want to remove page name from all pages then use

    <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
    <?php if(!is_page()): ?>
    <header class=”entry-header”>
    <h1 class=”entry-title”><?php the_title(); ?></h1>
    </header>
    <?php endif; ?>
    This should be in child theme in Twenty Twelve content-page.php, and if it is just the home page then as dbeja say’s use is_front_page…

    Thanks for the posts. Great help for newb. Really appreciate it.

    Hi, I tried to change my Twenty Twelve HOME blog page to be called BLOG in my child theme CSS, using the method of WPyogi, eg.

    body.home .entry-header {
        display: BLOG;
    }

    Not knowing CSS coding very much yet, I guessed and found the section which seemed to be about basic page settings. I added the above code right after:
    `html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    vertical-align: baseline;
    }

    That’s not valid CSS – see: https://www.w3schools.com/cssref/pr_class_display.asp

    You’re trying to do something totally different – so please start a new thread per: https://codex.www.ads-software.com/Forum_Welcome#Where_To_Post

    That W3 schools info is all foreign to me; I would not know how to use it, unless I spend a week or more studying it, which I don’t have time to do. I’ll just have to leave my page called Home. Thanks anyway.

    @diana don’t give up! if you start another thread your questions will be dealt with ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘How to remove page name in twentytwelve theme’ is closed to new replies.