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(' — ', __('« Older Posts'), __('Newer Posts »')); ?>
</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.