How do I put H1 Tags here and not there (Wordpress)

11 replies
  • WEB DESIGN
  • |
I am trying to find a way to have an H1 tag on my main page, but not have it show up on my post pages where the post title is the H1.

The website is www(dot)KFX700Parts(dot)com.

Please ask all the questions you need, any help would be appreciated!
#put #tags #wordpress
  • Profile picture of the author camay123
    Maybe edit a template file (depending on how your wordpress is setup for mainpage) and/or use a conditionnal tag ?
    {{ DiscussionBoard.errors[6926913].message }}
    • Profile picture of the author JohnRedick
      How do I use a conditional tag?

      The way it is set up now is the main page H1 is now H2, that way the post pages will only have 1 H1 tag which would be the post title.
      {{ DiscussionBoard.errors[6926934].message }}
  • Profile picture of the author camay123
    See here:

    Conditional Tags « WordPress Codex

    I beleive if your main page template only have h2 right now.... add an h1 where you want it and style it via css. Probably no needs for conditionnal tags.

    You would use http://codex.wordpress.org/Condition...#The_Main_Page for the homepage conditional tag
    {{ DiscussionBoard.errors[6927007].message }}
  • Profile picture of the author cssbros
    Hello,

    You can try setting up a custom home page template, and have the post page separated on your theme.

    Hope that works.
    {{ DiscussionBoard.errors[6927517].message }}
    • Profile picture of the author JohnRedick
      Ok, so say I want this line of code to only be H1 on the main page,

      <h1 style="padding: 4px; font-size: 12px; font-weight: bold; text-align: center; margin: 0 auto; color: #fff;">Find Fenders, Bumpers, Grab Bars, Exhaust And Performance Parts You Need To Make Your Kawasaki KFX 700 V-Force Your Custom Machine!</h1>)

      How do I make it NOT H1 on every other page on the site?

      I checked out the conditional tags, but my knowledge of Wordpress is significantly lacking so it didn't make much sense.

      I did try putting the "is_home()" around the line of code but killed the page, so that's obviously not how to do it.

      John
      {{ DiscussionBoard.errors[6928168].message }}
  • Profile picture of the author camay123
    I believe you would not need a conditionnal tag if you put in the proper telplate file.

    I believe it should be called home.php

    Let me know if you need further help, i can do it for you.
    {{ DiscussionBoard.errors[6929648].message }}
    • Profile picture of the author sodomojo
      Is there a good plugin tht does this effectively for you ?
      {{ DiscussionBoard.errors[6930024].message }}
      • Profile picture of the author camay123
        Originally Posted by Tydowns View Post

        Is there a good plugin tht does this effectively for you ?
        I might be wrong but I dont know of any one.
        {{ DiscussionBoard.errors[6930384].message }}
  • Profile picture of the author JohnRedick
    I looked around for a plugin to help my situation, but they are all site wide H1 tags.

    I did figure it out though with this code I copied from another site I had installed with a premium theme.

    <?php if ( is_home() ) { ?>
    <h1 style=”display:none;”><Find Fenders, Bumpers, Grab Bars, Exhaust And Performance Parts You Need To Make Your Kawasaki KFX 700 V-Force Your Custom Machine!></h1>
    <?php } else { ?>
    <?php

    Thanks for all your help Warriors!
    {{ DiscussionBoard.errors[6934016].message }}
  • Profile picture of the author londoncoffee
    You could simply add some custom css and then style accordingly. Your homepage has the class of home and you only need to add something like this:
    .home H1 {font-size: 20px} or
    .home H2 {font-size: 15px}
    If its for SEO, then maybe this isn't the best way, but if you just want to increase H1 or H2 size purely for apperances, then its the easiest way.
    {{ DiscussionBoard.errors[6934986].message }}
  • Profile picture of the author nstephan
    Conditional Tags would be your best bet!
    {{ DiscussionBoard.errors[6935862].message }}

Trending Topics