Git Product home page Git Product logo

Comments (3)

nate-allen avatar nate-allen commented on June 19, 2024

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;

from gutenberg-starter-theme.

audrasjb avatar audrasjb commented on June 19, 2024

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

from gutenberg-starter-theme.

nate-allen avatar nate-allen commented on June 19, 2024

@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.

from gutenberg-starter-theme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.