• dbzeng

    (@dbzeng)


    I want to hide the title and description from the top of the page on this single page at https://www.greenyourhome101.com/newsletter-sign-up/

    Everything above where it starts to say “easy ways” I’d like to hide.

    The theme, clearline, gives me an option to hide it but it’s on every single page not just this one. But that still leaves the green bar.

    Look forward to your help

Viewing 6 replies - 1 through 6 (of 6 total)
  • chinmoy29

    (@chinmoy)

    use conditional tags like is_page(‘newsletter-sign-up’) in header.php file

    Thread Starter dbzeng

    (@dbzeng)

    what would be the exact code i’d use? im not too fluent in code language

    Amazing how nobody has a definitive answer to this simple question and believe me, I’ve looked.

    I similarly want to hide the site title and description from my landing page, which is a static page. It’s a splash page which uses the blank template and has no header, hence the title ends up on the main image which I don’t want. I just need to hide, not remove the title. I can accomplish this site-wide but don’t know how to apply it to a particular page.

    I know this thread is old but frankly I couldn’t be bothered creating a new thread, especially as noone ever replies to them. Sorry to sound negative. It’s just that I’ve never found an complete answer to any of my questions on this forum anyway, although sometimes people provide useful links to other resources which has sometimes helped.

    I can’t code, haven’t programmed anything in 15 years and CSS PHP etc is new to me. I’m using the weaver theme and the site isn’t online so I can’t provide you with a link. If anyone can help out I’d be truly thankful.

    If the original poster still needs help after nine months, then the exact code would be:

    <?php if ( ! is_page( 'newsletter-sign-up' ) { ?>
    <?php if (is_home()):?>
        <h1><a href="<?php echo home_url( '' ); ?>/"><?php bloginfo('name'); ?></a></h1>
    <?php else:?>
        <h3><a href="<?php echo home_url( '' ); ?>/"><?php bloginfo('name'); ?></a></h3>
    <?php endif;?>
        <div class="description"><?php bloginfo('description'); ?></div>
    <?php } ?>

    The bit inside the conditional is already in “header.php”; I just added it to make clear what part to surround.

    A slightly easier way would be to use the conditional already in place; replace this line:

    <?php if ($options[$shortname . '_show_blog_title_and_description']=='yes'):?>

    with:

    <?php if ($options[$shortname . '_show_blog_title_and_description']=='yes' && ( ! is_page( 'newsletter-sign-up' ) ) ):?>

    As for the new question, I don’t use the Weaver theme so I have no idea what its file structure is or how it goes about doing things and without seeing the generated code of your site I can’t infer how it works. The code your looking to alter is usually found in the theme’s “header.php” file. If you find the code used to display the title…

    Probably looks something like this:
    <h1><?php bloginfo('name'); ?></h1>

    …then you can wrap it in a conditional that causes it to refrain from displaying on the “front” page:

    <?php if ( ! is_front_page() ) { ?>
    <h1><?php bloginfo('name'); ?></h1>
    <?php } ?>

    If your site’s styling goes wonky without having that <h1> tag (or whatever tag used in displaying the title) then you could do something like:

    <?php if ( ! is_front_page() ) { ?>
    <h1><?php bloginfo('name'); ?></h1>
    <?php } else { ?>
    <h1></h1>
    <?php } ?>

    @BigBagel

    Thanks for taking the time to respond. The Weaver Theme I’m using actually provides a list of nifty “per-page” check-box options which, among other things, allows you to hide the Site Title/Description on any particular page. It’s designed for bumpkins like me who don’t do code! This works perfectly well but it doesn’t just “hide” the title text from visitors, it appears to remove the title altogether; which isn’t a very search engine-friendly of doing things! It’s only when I unchecked the hide option that google started indexing the page in question…at the expense of unsightly title text scrawled all over my splash page!

    I’m hoping to relaunch the site again soon and would like to ask if the solutions you kindly provided are actually the hacked version of the same thing I’ve been doing through the theme’s admin interface. i.e. removing the title, rather than simply hiding it from view?

    Any thoughts?

    TIA

    There are a few ways Weaver could conditionally remove the visible title. As long as a <title> tag is being generated (completely separate from the visible title on the page) search engines and browsers will use that as a page’s title. You can look at the source code of one of the pages with the hidden title and look for something like <title>I'm the title</title> near the top.

    If Weaver isn’t adding a title tag on pages that have their visible title removed or on any pages (which is why a search engine would fall back on guessing the title from text on the page) then you might consider one of the SEO plugins available in the repository. You can also manually add an automatically generated title tag in the php. The more popular SEO plugins have a lot of nice features, but If you decide to go the manual route I can look at Weaver and let you know what to do.

    I think the timing of Google indexing that page was just coincidental; it should index the page regardless of any visible title or title tag. It can take a few days (or longer) for search engines to add pages. While I’m happy to help, if you have any theme related questions or problems, starting a topic under Weaver’s theme repository page or in Weaver’s support forum would probably get you some faster, more specific responses from people that are more knowledgeable about the theme.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How To Hide Blog Title & Description On Single Page’ is closed to new replies.