Support » Themes and Templates » Add H1 title to posts page

Viewing 7 replies - 1 through 7 (of 7 total)
  • Flash Buddy

    (@flashbuddy)

    I’m not sure I understand the question. I didn’t “stay in school” 😉

    Blog posts are single.php.

    <h1><a href="<?php the_permalink(); ?><?php the_title(); ?></a></h1>

    You could also target a page with php, something like:

    if is page 2
    echo <h2>Your title….
    else
    do something else or nothing all.

    jknetdesign

    (@jknetdesign)

    http://demo.princessmontereywhalewatching.com/sightings/captains-report/

    How do I add the page title ‘Captain’s Report” to this page so it looks the same as any other page on the site. On other themes like Twentyten and Toolbox I used category.php but it does not seem to work that way with Twentyeleven since it’s so bloated. The file single.php is for he single posts.

    Michael

    (@alchymyth)

    Forum Moderator

    try and add the new code into index.php, after this line <div id="content" role="main">

    <?php if( is_home() && get_option('page_for_posts') ) {
    	$posts_page_id = get_option('page_for_posts'); ?>
    	<header class="entry-header">
    		<h1 class="entry-title"><?php echo get_the_title($posts_page_id); ?></h1>
    	</header><!-- .entry-header -->
    <?php } ?>
    jknetdesign

    (@jknetdesign)

    Thanks Sweeper, it positioned itself nicely without the <header> tags. Would you mind looking at something else? I have a similar situation with the breadcrumbs plugin. I placed this snippet in content-page and the position is perfect but how would I incorporate this on hte blog page?

    <header class="entry-header">
        <div class="breadcrumbs">
        <?php if(function_exists('bcn_display'))
        {
            bcn_display();
        }?>
    </div>
    jknetdesign

    (@jknetdesign)

    I take that back, I need the entry-header class there so the sidebar stays in place. But now the css is out of wack on that first post. Any suggestions?

    mohdrafie

    (@mohdrafie)

    Shouldn’t you close the <header> tags? 😉

    jknetdesign

    (@jknetdesign)

    Yes, I’m just showing where the crumbs div is placed. Trying to get the breadcrumbs to show on the posts page. Do I use the same type of conditional statement Sweeper gave me? or somehow incorporate the crumbs function inside that same statement?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Add H1 title to posts page’ is closed to new replies.