• Resolved losapuntesdelviajero

    (@losapuntesdelviajero)


    Hi! I have h1 titles in ally my pages, except in the page showing “all entries” (the page I’ve created and selected as “blog” in WordPress settings). I’ve tried with hooks and also with a custom function in functions.php, but can’t achieve it. What can I do? Thanks!

    PS.: Can’t add any other content to that page (h2, p, images, etc.).

    Thanksss!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • ying

    (@yingscarlett)

    Hi there,

    That’s correct, blog is an index page, it does not have an h1 title by default, you can not edit it like a static page.

    Try adding this PHP code:

    add_action('generate_before_main_content', function() {
    if (is_home()) {
    echo "<h1>Blog</h1>";
    }
    });
    Thread Starter losapuntesdelviajero

    (@losapuntesdelviajero)

    Hi! Thanks for your reply, ying ??

    There a was a little mistake in your code, but it worked after I fixed it. Thanks! Finally, I made some changes and I got this to show the h1 only on the blog:

    add_action('generate_before_main_content', function() {
    if (is_home() && is_main_query()) {
    echo '<h1>Todos nuestros artículos
    </h1>';
    }
    });

    Thank youu!

    ying

    (@yingscarlett)

    No Problem ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.