• Resolved whoamianyway

    (@whoamianyway)


    Hi, I hope someone can help me as I’ve been struggling with this one for ages now.

    I have used the bootstrap-canvas-wp theme to create a child theme to match my existing website. Everything seems to be working fine, apart from one issue. I have asked this in the forum for the theme, but have had no reply.

    If you look here, you will see that the post titles are not showing on the homepage, or the single post page, but they are showing on the category and archives pages.

    The theme uses a loop, and the following code is present in the loop:

    <div class="blog-post" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            <!-- check if the post has a Post Thumbnail assigned to it. -->
            <?php if ( is_singular() && has_post_thumbnail() ) : ?>
            <?php the_post_thumbnail( 'full' ); ?>
            <?php elseif ( has_post_thumbnail() ) : ?>
            <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
            <?php the_post_thumbnail( 'thumbnail' ); ?><?php the_title(); ?>
            </a>
            <?php endif; ?>
            <?php if ( !is_singular() ) : ?>
            <h2 class="blog-post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php esc_attr_e( 'Permanent Link to ', 'bootstrapcanvaswp' ) . esc_attr( the_title_attribute() ); ?>">
            <?php the_title(); ?></a></h2>
            <?php else : ?>
            <h2 class="blog-post-title"><?php the_title(); ?></a></h2>
            <?php endif; ?>
            <?php if ( !get_the_title() ) : ?>
            <?php else : ?>
            <p class="blog-post-meta"><span class="glyphicon glyphicon-calendar"></span> <?php the_time( $date_format ) ?> by <span class="glyphicon glyphicon-user"></span> <?php the_author_link() ?></p>
            <?php endif; ?>

    Does anyone have any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter whoamianyway

    (@whoamianyway)

    I’ve tried deactivating plugins, which doesn’t work, and if I switch themes to twentyfifteen, the problem goes away, so it must be a theme problem, I think. I’ve done extensive googling and not found a solution yet.

    the linked web page is not using the shown loop code – for example, there is no .blog-post CSS class in that page’s html output.

    if the shown loop code is used for single posts, then for example the applied logic for the title is flawed – it depends on a featured image to be present in the single post….

    Thread Starter whoamianyway

    (@whoamianyway)

    Thanks, Michael, I was getting really frustrated. I created the child theme using instructions on another site which were based on twentytwelve. Once I got the hang of it, I did the category.php, tag.php, etc files, but before then (for index and single) I’d copied the given code directly. Completely forgot about this and could not see where I was going wrong for the life of me!

    Thank you. Learning on the job is fun but very irritating sometimes! I’ve now tidied up all the pages so they have the same divs and structure based on the original site code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Post titles not showing on index page’ is closed to new replies.