WordPress.org

Ready to get started?Download WordPress

Forums

Lightword Theme H1 tag only on homepage (2 posts)

  1. xtrz
    Member
    Posted 1 year ago #

    Hi, i use Lightword theme and really like it. But i have a little problem that i can't resolve. I want Title on the blog to have h1 tag only on home page and on post pages h1 tag must be title of the posts. I can edit my single.php and add h1 tags to posts, but my problem is title on the blog.

    here is the code i found:

    <div id="top_cufon"><h1 id="logo">" href="<?php if(function_exists('home_url')) echo home_url(); else bloginfo('url'); ?>"><?php bloginfo('name'); ?> <small><?php bloginfo('description'); ?></small></h1></div>

    If somebody can help me i will be very grateful thanks.

  2. francomusso
    Member
    Posted 1 year ago #

    If I understand you correctly, you want to have a specific heading at the top of your blog listing page, but use the post's title as the heading at the top of your blog posts?

    I would add the following in index.php

    <?php
    if ( is_front_page()) { ?>
       <h1>A standard heading</h1>
    <?php } else { ?>
        <h1><?php the_title(); ?></h1>
    <?php } ?>

    The posts themseleves will continue to use the post title as per your single.php

    I hope that helps!

Topic Closed

This topic has been closed to new replies.

About this Topic