• Hello,

    My single post title tags are getting messed up. All of my files provide h2 tags for the post title, but when you view the single post the title is placed in a h1 tag and is dramatically reduced in size.

    I have looked at all my theme files and all my WP files and can not find any reference to the h1 tag. What would cause the system to swap out the h2 tag for an h1 tag?

    index.php
    <div id=”contentleft”>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h2>” rel=”bookmark”><?php the_title(); ?></h2>

    page.php
    <div id=”contentleft”>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h2 class=”single”>” rel=”bookmark”><?php the_title(); ?></h2>

    home.php
    <div id=”contentleft”>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h2>” rel=”bookmark”><?php the_title(); ?></h2>

    archive.php
    <div id=”contentleft”>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h2 class=”single”>” rel=”bookmark”><?php the_title(); ?></h2>

    There is no single.php file available, but the source when viewing a single post is as follows.
    <div id=”contentleft”>
    <h1>
    H-Tag Post Title Bug
    </h1>

    I know nothing about php and am only a novice at html and css. Fixing this is beyond me. I have come to the conclusion that the problem does not exist in any of the formats mentioned above and is a php issue of some sort.

    Any help would be greatly appreciated. The site can be found at https://www.hybridseo.com and the theme is Elements of SEO

Viewing 15 replies - 1 through 15 (of 18 total)
  • i downloaded the latest Elements of SEO, and it has a h1 tag in index.php:

    <?php get_header(); ?>
    
    <div id="content">
    
    <div id="contentleft">
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>

    go and edit it.

    Thread Starter mostever

    (@mostever)

    Thanks for the try, but I have done that already. I may not have titled my code above properly, but this is the snipit from the index.php file I have.

    <div id=”contentleft”>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h2>” rel=”bookmark”><?php the_title(); ?></h2>

    are you running a cache plugin or something similar?

    do have any cache plugins or other cache software activated?

    Thread Starter mostever

    (@mostever)

    I am not sure how to answer that. I have a standard installation with a few plugins like, sitemap, seo all in one, feeburner, and cforms. I can make updates to files and see instant results, so I do not believe it to be a caching issue especially since the code is clearly showing a h1 tag being used for several days now.

    maybe the best thing to do – not a solution, but a masking of the effect:
    in style.css, add ‘#content h1’ to the corresponding h2 styles:

    #content h2, #content h1 {
    	color: #000000;
    	font-size: 20px;
    	font-weight: bold;
    	letter-spacing: 0px;
    	margin: 42px 0px 3px 0px;
    	padding: 20px 0px 5px 5px;
    	/*text-transform: uppercase;*/
    	font-family: Georgia, "Times New Roman", Times, serif;
    	border-bottom: 4px double #000000;
    	border-left: 4px double #000000;
    }
    
    #content h2 a, #content h1 a  {
    	color: #41a317;
    	text-decoration: none;
    }
    
    #content h2 a:hover, #content h1 a:hover {
    	color: #151b8d;
    	text-decoration: none;
    }

    at least it is not obvious then it gives you more time to find the cause ??

    Thread Starter mostever

    (@mostever)

    Interesting. I tried the above temp solution, and it changed all of my title tags to look as the h1 did. This might help in figuring the problem. It is actually ignoring my css rules now and displaying all of the title tags in the much smaller font. I will leave it this way for a bit as I go about investigating more. Thanks for the suggestion.

    Thread Starter mostever

    (@mostever)

    I am sure I can fix the look of this by targeting the #contentleft and adding a more specific rule. This will most likely fix the aesthetics, but I will still have to search and destroy whatever it is that is inserting the h1 tag in the first place.

    there needs to be a comma inbetween the h2 and h1 styles (see my posted code)
    #content h2, #content h1
    #content h2 a, #content h1 a
    #content h2 a:hover, #content h1 a:hover

    Thread Starter mostever

    (@mostever)

    LOL ah, I know better than that. I was trying to do to many things at once. Thanks for the insight. It looks better now. I should probably remove my bug post so as not to confuse anyone. I will continue my search for the real culprit though. Thanks again.

    Thread Starter mostever

    (@mostever)

    Great, now my visual editor stopped working. Both visual and html shows code. Time to shut it down, clear cache, and reboot. I have not changed any files other than theme files, so the fact that the visual editor is now acting up is really weird.

    Thread Starter mostever

    (@mostever)

    I guess all of the above is the least of my worries. Viewing my page in Opera 9.52 and Chrome 3.0.195.38 shows my header completely out of shape. I never even considered viewing in them before because all my html and css testing showed them almost identical across the board.

    Find one problem and it always leads to another. I guess Elements of SEO is going bye bye and I will be working on something new. This is sad. To many problems for such a simplistic theme to have.

    Hey alchymyth!

    you did great helping linda at https://lindabos.net/ with the snapshot theme. Im also having trouble with the theme an cant get support my site is https://NewShid.com I want to be able to:

    1. show more post on the main pages its currently at 10
    2. is it possible to add an extra widget sidebar on the right I know we would have to increase the width of the fullspan first

    Any help would be greatly appreciated thanks!

    As soon as I edited the home.php it worked for me, there is something else wrong. I don’t know what else you edited but a few other elements on the page look off so I would download a fresh version of the theme again and go from there.

    Good luck, if you figure out how to solve it let us know.

    SS

    @marcjordan88
    better open a new thread – i got you here only by chance ??

    your first question:
    edit index.php and add a query before the line with ‘while (have_posts…’:

    <?php
    	$counter = 0; $counter2 = 0;
    
    	query_posts($query_string.'&posts_per_page=20');
    	//set the number you want to show, -1 for all
    
    	while (have_posts()) : the_post();
    			?>

    instead of 20 put the number of post you would like to ahow on the front page.

    your second question:
    to build a second sidebar into any theme depends on the html structure of theme files, and the ‘philosophy’ of the theme author behind it.
    if i would try to do this for a given theme, my first step would be to take a copy of the html from the browser (ignoring wordpress and php at this moment) and try to expand the html to generate a second sidebar in the chosen position (i work with dreamweaver, but any other development system would do) and to adapt the css (default.css for instance) to get the formatting right.
    only then, i would put the working structur into all theme files that may be effected, and make a new sidebar-2.php file with the wordpress codes for dynamic sidebars.

    that is a lot of work, and general guiding someone through the process is well beyond this help forum.
    if you have any problems in the last step (integrating the wordpress functions), then this forum is right again.

    if you really ned two sidebars to accomodate all your stuff, i suggest to search through the lists of existing (free) themes ??

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Single Post Title Formating’ is closed to new replies.