• I have a site running wordpress (https://dev.intensitynutrition.com). I have a static home page (which is a page) and a /blog page where I want my blog postings to show up. For some reason, I cannot get the title of the postings to show. I have tried creating a blog.php template, but it doesn’t work so I scratched that. Here is my main template code:

    <div style="margin-left: auto; margin-right: auto;"></div><?php
    if ( have_posts() ) : while ( have_posts() ) : the_post();
    the_content();
    endwhile;
    else:;
    endif;?>

    Anyone have any help as to what I am missing in order to get my postings title and link and suchs on dev.intensitynutrition.com/blog?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try using:

    <div style="margin-left: auto; margin-right: auto;"></div><?php
    if ( have_posts() ) : while ( have_posts() ) : the_post();?>
    
    <h2 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Post');?> <?php the_ID(); ?> - <?php _e('permanent link');?>"><?php the_title(); ?></a></h2>
    
    <?php the_content();
    endwhile;
    else:;
    endif;?>

    in index.php – the template file used by your blog page.

    Thread Starter zacnin

    (@zacnin)

    That worked for the most part – titles are now showing. But it also showed the title on all of the pages, which I don’t want. Is there a way to show the permalink on the posts only, and now have it show up on the pages?

    Dopes your theme have a page.php template file? If not, create one by copying the code from the original index.php file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Blog not showing title’ is closed to new replies.