WordPress.org

Ready to get started?Download WordPress

Forums

How Do I remove the Page Titles from Static pages? (18 posts)

  1. Shan
    Member
    Posted 3 years ago #

    I am designing a website for a client and they are using it as a stsic website. I need to remove the page titles from the individual pages, but not from the nav bar or the blog feature.

    I have looked at all of the other threads regarding this issue but the fixes either don't work or I just don't get it. Is there a way to just comment it out in the php somewhere?

    The test site is here: http://lighthouseinternetservices.com/Testing/

  2. govpatel
    Member
    Posted 3 years ago #

    In your page.php look for this code

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

    change that to

    <?php if ( is_front_page() ) { ?>
          <h2 class="entry-title" style="display:none;"><?php the_title(); ?></h2>
    <?php } else { ?>
          <h1 class="entry-title" style="display:none;"><?php the_title(); ?></h1>
    <?php } ?>

    all have done is add

    style="display:none;"

  3. Shan
    Member
    Posted 3 years ago #

    Thank you! Now this will only affect the page titles not the post titles, correct?

  4. Shan
    Member
    Posted 3 years ago #

    Ok I don't have any code similar to this in page.php

  5. govpatel
    Member
    Posted 3 years ago #

    Looking back at your css looks like the theme is using post title instead of entry title

    <h2 id="post-9" class="post-title">
    <a title="Permanent Link:" rel="bookmark" href="http://lighthouseinternetservices.com/Testing/accomodations/">Accommodations</a>

    you can not display them from layout.css

    .post-title {
    margin:0;
    padding:0;

    add
    display:none;

  6. Shan
    Member
    Posted 3 years ago #

    Ok, that worked, but won't that affect any blog post titles as well? I want to make sure this is only for the page titles. The client may want a blog in the future for news, etc. and with no titles, that would look bad.

  7. govpatel
    Member
    Posted 3 years ago #

    Will have to see what is used on blog page if it is same then will have alter the code all you have done is add that display:none; can always take out.

  8. Shan
    Member
    Posted 3 years ago #

    Yes, I understand that. But should the client want a blog in the future, I will be back to the same problem of needing the page titles gone while keeping the post titles intact. LOL

  9. govpatel
    Member
    Posted 3 years ago #

    if you can create blog page so we can see as this is your testing website

  10. Shan
    Member
    Posted 3 years ago #

  11. govpatel
    Member
    Posted 3 years ago #

    ok If you can take that display:none; out and if you can paste your index.php and page.php codes in http://wordpress.pastebin.com and submit paste url here so that we can see the code that creates that title on pages.

  12. vtxyzzy
    Member
    Posted 3 years ago #

    Try this. In page.php, change this:

    <div <?php post_class(); ?>>
    
    <h2 class="post-title" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link:', 'zenlite');?>"><?php the_title(); ?></a></h2>
    <ul class="meta">

    to this:

    <div <?php post_class(); ?>>
    
    <?php if (is_page()) : ?>
    <h2 class="post-title" id="post-<?php the_ID(); ?>"><a>" rel="bookmark" title="<?php _e('Permanent Link:', 'zenlite');?>"><?php the_title(); ?></a></h2>
    <?php endif; ?>
    <ul class="meta">
  13. Shan
    Member
    Posted 3 years ago #

    Ok here they are

    Page.php: http://wordpress.pastebin.com/xUUzNyve

    Index.php: http://wordpress.pastebin.com/n3k8ye2M

    @vtxyzzy I will try that. Give me a minute.

  14. Shan
    Member
    Posted 3 years ago #

    OK that did not work.

    I get this as the title now:

    " rel="bookmark" title="Permanent Link:">Home

    Uggh.

  15. govpatel
    Member
    Posted 3 years ago #

    Try this looks like left out href in the code.

    <div <?php post_class(); ?>>
    
    <?php if (is_page()) : ?>
    <h2 class="post-title" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link:', 'zenlite');?>"><?php the_title(); ?></a></h2>
    <?php endif; ?>
    
    <ul class="meta">
  16. Shan
    Member
    Posted 3 years ago #

    Nope. That didn't work either.

  17. vtxyzzy
    Member
    Posted 3 years ago #

    Sorry, I left out an exclamation mark. It should be this (I think):

    <div <?php post_class(); ?>>
    
    <?php if ( !is_page() ) : ?>
    <h2 class="post-title" id="post-<?php the_ID(); ?>"><a>" rel="bookmark" title="<?php _e('Permanent Link:', 'zenlite');?>"><?php the_title(); ?></a></h2>
    <?php endif; ?>
    <ul class="meta">
  18. deedles916
    Member
    Posted 3 years ago #

    Thank for the advice in this post... it helped tremendously!!!

Topic Closed

This topic has been closed to new replies.

About this Topic