WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Making post titles *not* be permalinks? (14 posts)

  1. mhgaither
    Member
    Posted 3 years ago #

    I just converted my old B2 site into WP. At present, all of the post titles appear as permalinks. How do I make the titles just normal black text? Is that a CSS edit, or is there a setting in WP?

    (New to WP, obviously...wasn't sure if this is any easy fix or if I have to noodle with the style sheet.)

    Site is http://www.michaelgaither.com/home.

    Many thanks.

  2. Michelle Panulla
    Member
    Posted 3 years ago #

    Hi!

    There are two possible questions you're asking and I'm not quite sure which. The first is just making the links show as black text. The second is removing the link altogether and leaving the titles as text-only.

    I'll assume the first and if I'm wrong, please say so.

    This is a CSS edit. Using FTP or similar, open your CSS file in an editor. I took the liberty of using the Firebug plugin for Firefox (highly recommended for debugging) and see that your CSS file is located at http://www.michaelgaither.com/home/wp-content/themes/michaelgaither/michaelgaither/style.css .

    Because line 36 has the color for links listed as "a:link" it is overruling the later style on line 66 for links in the h2 to be black. You should be able to fix this by removing the ":link" on line 36, so that your style reads

    a {
    color:#435F97;
    text-decoration:underline;
    }

    This will allow the later style rule. You could also add the ":link" to line 66 if you wanted to go that way instead.

    If you want the underline to go away, too, you can add a rule after this that reads

    h2 a {
    text-decoration: none;
    }

    Good luck!

  3. mhgaither
    Member
    Posted 3 years ago #

    This is exactly what I wanted. (I really just want the post titles to be black text and not links. Snce I have a permalink avail at the bottom of each post, making the title a pm is redundant...and really just not as nice looking.

    I'll make this fix. Many thanks.

    - Michael

  4. Michelle Panulla
    Member
    Posted 3 years ago #

    Great! Just so you know, the titles will still be links; they just won't look like they are. ;) Removing the actual link is more complicated because you need to do that in multiple places.

  5. Removing the actual link is not difficult; find and edit the title and permalink php in your theme files, like index.php, single.php, page.php, etc. Will look fairly close to this:

    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>

    Change it to

    <h2><?php the_title(); ?></h2>

    to remove the hyperlink

  6. mhgaither
    Member
    Posted 3 years ago #

    Hi Mpanulla - I made your suggested code changes, but it didn't seem to affect anything. (Text isn't black.) Did I miss something? Thanks so much for your time.

    - Michael

  7. Michelle Panulla
    Member
    Posted 3 years ago #

    Oh, yeah - sorry. My bad. Your code on line 66 is still telling your header link to be blue. You should change

    h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    color:#435F97;
    }

    to

    h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    color:#000000;
    }

    This will cause any links in headers to be black, though, so you may want to add a special rule for the h2 header below your other code like this

    h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    color:#435F97;
    }
    
    h2 a {
    color:#000000
    }

    in order to preserve the blue color on the other header links.

    Apologies for missing that part!

  8. mhgaither
    Member
    Posted 3 years ago #

    Whew. All of that seemed to work. Post titles are now in black text, and they're no longer links. Thanks so much!

    One more quick question: The "unvisited" links in my posts (and my sidebar) still are all underlined, even though I withdrew the "underline" statements from my css file.

    Note: The links are the correct colors when they're visited/unvisited. I'd just like to completely turn of underlining, since it's way too busy.

    Thanks again,

    - Michael (michaelgaither.com/home)

  9. Michelle Panulla
    Member
    Posted 3 years ago #

    Ah, they have a class applied to them, but there's no rule set up for it. Just go to the end of your CSS file and put in the following.

    .sidebar1 a {
    text-decoration: none;
    }
  10. mhgaither
    Member
    Posted 3 years ago #

    Bummer. No change at all. Any other ideas? Thanks again for everything.

  11. Michelle Panulla
    Member
    Posted 3 years ago #

    It's possible you saw the code before my edit. I accidentally posted a version first that only took them off the one section. See the new code, and lemme know if it's still not working. =)

  12. mhgaither
    Member
    Posted 3 years ago #

    That took care of the sidebar underlines. Any idea what's making them stick in the main body posts?

  13. Michelle Panulla
    Member
    Posted 3 years ago #

    Oh sorry - didn't realize you wanted them off in the body, too, and not just the sidebars. Remove the colon after the "a" on line 36.

  14. mhgaither
    Member
    Posted 3 years ago #

    Perfect! Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Topic