• Thanks to you fine people on Codex, I found out how to take the post title of my static pages that I’m using for my website.

    However, I want post titles for my blog which is one of the pages but not static.

    How do I get the titles on the posts but not on the static pages? What PHP file should I modify? What code does that?

    I read that I can have titles on any posts if they are categorized blog posts. But, what PHP file is that?

    Thanks.

Viewing 15 replies - 1 through 15 (of 37 total)
  • This is for the Twenty Ten theme but might help!

    The page and post titles often share the same class, like in twenty ten they both use the class “entry-title”.

    Changing the style.css entry to display:none; is not the way to go, as you still want the search engings to see the title, and you still need post titles.

    You add an inline style in the page.php and single.php files, like:

    <h2 class="entry-title"></h2>

    This changes to:

    <h2 class="entry-title" style="display:none;"></h2>

    HTH

    David

    Thread Starter hunterdiamond

    (@hunterdiamond)

    David – thanks so much for the reply. I used Artisteer to design the template. I went into the PHP files you suggested in WordPress.

    But, I can’t figure out where to place the text. In page.php file, I saw h1 but not h2. Does that work in there?

    thanks,
    Anne

    I have the same question. I have several static pages (Home, About, Blog, Contact, etc.) where I don’t want the page titles to appear. So I’ve used the display:none in my styles.css.

    But I DO want my titles to appear on the Blog posts.

    I’ve tried the above suggestions, but, like Anne, I’m not sure exactly to put the line of code in the page.php file.

    Any further suggestions will be helpful.

    Paul

    If you using twenty ten theme and its there

    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    					<?php if ( is_front_page() ) { ?>
    						<h2 class="entry-title"><?php the_title(); ?></h2>
    					<?php } else { ?>
    						<h1 class="entry-title"><?php the_title(); ?></h1>
    					<?php } ?>

    Thread Starter hunterdiamond

    (@hunterdiamond)

    govpatel,

    I’m not using twenty ten theme. So, if I use this code, where do I put it? What part or php file does it go into???

    thanks.

    Paste your page.php file in http://wordpress.pastebin.com so that can see what you have.

    Thanks for the assistance. I’m using Thematic theme and found the answer to my question on the Thematic forum. Once I found the right code to paste into my functions.php file, it works as I’d hoped it would.

    Thanks again.
    Paul

    Thread Starter hunterdiamond

    (@hunterdiamond)

    govpatel – I already know what template I’m using. I’m using Artisteer to create my templates. When I go to the WordPress.pastebin.com, what am I doing there?

    Then what? Again, what php file should I put this code into?

    Pauledward – would you share what you did, what the code is for you?

    I’m sorry if this is increasingly frustrating but I’ve been waiting for close to 3 days with no resolution. I’m shocked that anybody replied. The reply rate is often 50% or less.

    Thanks,
    Anne

    Anne, I’m with you on the frustration part. I finally found what I was looking for on the Themeshaper forum.

    What I did may be specific to the theme I’m using, that is, Thematic.

    I put the following code in my functions.php file. That did the trick. It kept the page titles off the static pages yet kept the post titles on the blog page.

    It’s worth a try.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Sorry about the way the code looks. I forgot to mark it up.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thread Starter hunterdiamond

    (@hunterdiamond)

    pauledward – thanks so much. Did you remove any code? And, where did you paste this in the php? In my file, there are over 500 lines of code for this.

    Thanks again. You’re a peach.

    I know absolutely nothing about php code other than copy and paste. I found this code on the Thematic forum. Thematic is the theme I use. Look for the functions.php file and past the code in it. Go to the end of the file and paste the code right before the ?>.

    If it works, great. If not, well…

    This code may be theme-specific. If so, you may have to ask the author of the theme you’re using. If it’s twenty-ten, this seems the right place to ask the question. Maybe you’ll have to try again.

    Paul

    I’m using the twenty ten theme and have a static ‘Home’ page as my frontpage. I don’t wish to have the ‘Home’ title appear on my frontpage but do wish to have titles on all my other pages and post pages. Any ideas?

    Thread Starter hunterdiamond

    (@hunterdiamond)

    nikkidev – the easiest route is to got to Appearance and click on Editor. You’ll have a list of the different PHP files.

    Go to post_title.php and delete or save elsewhere the code. Leave it empty.

    Now you deleted the title on every page.

    Then, I went back to my website and put a title on every page using a header format. It’s in a fixed place on each page and don’t have to worry about the follow link showing through.

    Unfortunately, it also removes titles from you blog posts. So, I do the same and embed a title in my blog posting at the top until I find a work around.

    It’s an imperfect solution for now. It was either that or get hung up forever.

    Govepatel’s posting above is an another way to go and includes the code if you change the Twenty Ten layout.

    cheers,
    anne

    LJagermaster

    (@the-living-legend)

    @pauledward – I was just about to try this hack myself and something jumped out at me – the word “thematic” has been used a couple of times in the code you posted, which is a strong implication that it is a theme specific hack. However, many themes function in almost identical ways, it’s just they’re physical appearance that differs, so unless it can be confirmed to work on other themes without causing other issues it’s probably best not to try it out (I’ve tried out various “trial & error” hacks in the past and some have caused major damage to the site, so it’s really not worth it unless you have the time to restart from scratch).

    The site I’m working on just now is using a customised version of the Grunge Style theme so I’m definitely not going to try it until I know for sure… :-/

Viewing 15 replies - 1 through 15 (of 37 total)
  • The topic ‘Delete post title from static page but not blog’ is closed to new replies.