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

A title of the first post as a title of the home page #40

Open
koder95 opened this issue Oct 5, 2024 · 0 comments
Open

A title of the first post as a title of the home page #40

koder95 opened this issue Oct 5, 2024 · 0 comments

Comments

@koder95
Copy link

koder95 commented Oct 5, 2024

In home.php that line causes showing a title of the first post in h1 tag;

yith_proteo_print_page_titles();

It cause a double printing of a title of the first post on home page:

  1. in h1 tag as page-title
  2. in h2 tag as entry-title

It should be a hard code or calling a different function to print localized title of home page.

From WordPress Developer Resources:

  • page_for_posts: The ID of the page that displays posts. Useful when show_on_front‘s value is page.

So when is_home() == true then get_option( 'page_for_posts' ) always returns '0' and get_the_title( get_option( 'page_for_posts' ) ) always returns a title of the first post.

So:

<h1 class="page-title"><?php echo esc_html( get_the_title( get_option( 'page_for_posts' ) ) ); ?></h1>

never shows the correct title.

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

1 participant