WordPress.org

Support

Support » How-To and Troubleshooting » Titles not showing on posts – Quick fix from a brainiac here?

Titles not showing on posts – Quick fix from a brainiac here?

  • I’ve read through quite a few posts on this subject but so far have been unable to resolve why titles are not showing on my blog at http://www.grokthenet.com/spacedevserver. There’s no display:none, and titles seem to be called correctly on the single post page and index page. Any (fast) help gratefully appreciated.

    Here’s how the titles are called in single.php:

    <div class="title" style="padding:8px 0;">
    <h1 style="margin-left:0; margin-right:0; padding-left:0; padding-right:0;"><a>" target="_self"><?php the_title(); ?></a></h1>

    And here’s the CSS:

    .right title
    
    {
    
    	font-family:Arial, sans-serif;
    
    	font-weight:400;
    
    	font-size:18px;
    
    	text-transform: uppercase;
    
    }
    
    .right h1
    
    {
    
    	font-family:Arial, sans-serif;
    
    	font-weight:400;
    
    	font-size:18px;
    
    	text-transform: uppercase;
    
    }

    [see forum guidelines for posting code]

Viewing 11 replies - 1 through 11 (of 11 total)
  • I can’t tell if it is an artifact of how you pasted the code but that h1 tag is malformed. You are missing the start of the a tag really. Please re-paste the code inside backticks or use the ‘code’ button above.

    <div class="title" style="padding:8px 0;">
    <h1 style="margin-left:0; margin-right:0; padding-left:0; padding-right:0;"><a href="<?php the_permalink() ?>" target="_self"><?php the_title(); ?></a></h1>

    used the code button this time

    Ok. Where is that code? Can you post the whole file to the pastebin?

    Are you using this code in The Loop? If not, that i the problem, but you can get around it.

    Make sure the code rendering the titles on the single.php page is also present on your index.php page.

    Yes. duck_boy’s suggestion is one possibility. Your code is fine, so there has to be some reason that this isn’t printing to the screen. I need to see the whole file to get the context.

    ^^ Agree, put the whole file in to a Pastebin and we can help more.

    Here’s the full css:

    [ Eight hundred and seventy lines of code removed. For that many lines please use pastebin.com instead. ]

    Here’s the full single.php:

    <?php get_header();?>
    
    <div class="main-left">
    
    <?php get_sidebar(); ?>
    
    </div>
    
    <div class="main-right">
    
    	<div class="right-main"><div class="rpadding">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    			<div class="title" style="padding:8px 0;">
    <h1 style="margin-left:0; margin-right:0; padding-left:0; padding-right:0;"><a href="<?php the_permalink() ?>" target="_self"><?php the_title(); ?></a></h1>
    
    				<p><?php _e("Posted by "); ?><?php the_author() ?><?php _e(" in "); ?><?php the_category(',') ?><?php _e(" on "); ?><?php the_time('F dS, Y'); ?></p>
    
    				<div class="clear"></div>
    
    			</div>
    
    			<?php the_content(__('(more...)')); ?>
    
    			<div class="clear sep"></div>
    
    			<?php comments_template(); // Get wp-comments.php template ?>
    
    	<?php endwhile; else: ?>
    
    	<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    
    	<?php endif; ?>
    
    	<?php posts_nav_link(' — ', __('&laquo; Older Posts'), __('Newer Posts &raquo;')); ?>
    
    	</div></div>
    
    	<div class="clear"></div>
    
    </div>
    
    <?php get_footer(); ?>

    Your code does work.

    single.php is only used for single post displays, like this one– http://grokthenet.com/spacedevserver/proach-models-featured-in-ron-howard-tom-hanks-space-documentary/ It isn’t used for blog listings like this one– http://grokthenet.com/spacedevserver/ You need to edit index.php for that.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Titles not showing on posts – Quick fix from a brainiac here?’ is closed to new replies.
Skip to toolbar