WordPress.org

Forums

Titles not showing on posts - Quick fix from a brainiac here? (12 posts)

  1. bigpacific
    Member
    Posted 2 years ago #

    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]

  2. s_ha_dum
    Member
    Posted 2 years ago #

    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.

  3. bigpacific
    Member
    Posted 2 years ago #

    <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

  4. s_ha_dum
    Member
    Posted 2 years ago #

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

  5. David Gard
    Member
    Posted 2 years ago #

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

  6. dtrickky
    Member
    Posted 2 years ago #

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

  7. s_ha_dum
    Member
    Posted 2 years ago #

    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.

  8. David Gard
    Member
    Posted 2 years ago #

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

  9. bigpacific
    Member
    Posted 2 years ago #

    Here's the full css:

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

  10. bigpacific
    Member
    Posted 2 years ago #

    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(); ?>
  11. bigpacific
    Member
    Posted 2 years ago #

  12. s_ha_dum
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic