Add H1 title to posts page (8 posts)

  1. jknetdesign
    Posted 3 years ago #

    Yes, this is a child theme.

    How would I add an H1 to this blog page so it looks like any other page title. I tried adding text to content.php and category.php.


  2. Flash Buddy
    Posted 3 years ago #

    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....
    do something else or nothing all.

  3. jknetdesign
    Posted 3 years ago #


    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.

  4. Michael
    Forum Moderator
    Posted 3 years ago #

    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 } ?>
  5. jknetdesign
    Posted 3 years ago #

    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'))
  6. jknetdesign
    Posted 3 years ago #

    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?

  7. Mohd Rafie
    Posted 3 years ago #

    Shouldn't you close the <header> tags? ;)

  8. jknetdesign
    Posted 3 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic