Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong condition in header.php for site-title #74

Open
audrasjb opened this issue Sep 14, 2018 · 3 comments
Open

Wrong condition in header.php for site-title #74

audrasjb opened this issue Sep 14, 2018 · 3 comments

Comments

@audrasjb
Copy link

Hi,

Thanks a lot for this theme. I'm forking it for personal purposes, and I found a mistake related to site-title in header.php.

Nothing can meet the condition below:

if ( is_front_page() && is_home() )
@nate-allen
Copy link

A page can meet both conditions. If the settings under Settings->Reading->Your homepage displays are left at default, the home page will return true for both is_front_page() and is_home()

This is done for SEO purposes, so the H1 tag isn't used twice on a page. Whenever posts are shown on the front page, the site title is an H1 tag. If your blog isn't the front page, an H1 tag is used with this code:

if ( is_home() && ! is_front_page() ) :
    ?>
    <header>
        <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
    </header>
    <?php
endif;

@audrasjb
Copy link
Author

audrasjb commented Oct 1, 2018

Hi and thanks for your answer @nate-allen :)

I know it's good for SEO but this is not what I meant with this issue.
See the changes I made in the related PR (#75):
https://github.com/WordPress/gutenberg-starter-theme/pull/75/files

Thanks,
Jb

@nate-allen
Copy link

@audrasjb Hmm, I don't think this is a bug though. You said:

Nothing can meet the condition below:

if ( is_front_page() && is_home() )

But the default settings (Your homepage displays your latest posts) would meet those conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants