WordPress.org

Forums

How to remove title attributes from categories permalinks? (14 posts)

  1. rossrobbie
    Member
    Posted 4 years ago #

    Hello there!
    As you know in the end of each post there is that "postmetadata" information telling you when the post was published and witch category it's field under.
    The hole thing looks like that It's cool right?
    Now here's the problem. When I move the cursor on the link "Uncategorized"
    the title attribute appears saying: View all posts..
    Blah-blah-blah. I wonder how to make the title attribute disappear.
    How?

  2. curtismchale
    Member
    Posted 4 years ago #

    Go into archive.php and remove the title="<?php stuff ?>"> inside your link.

  3. rossrobbie
    Member
    Posted 4 years ago #

    Dude, there is no title!
    I'm using the imagination theme. That doesn't help :/

  4. vtxyzzy
    Member
    Posted 4 years ago #

    I think what you want to do is change index.php. Make a backup copy first, then change this:

    <?php the_category(', '); ?>

    to this:

    <?php
    foreach((get_the_category()) as $category) {
        echo '<a href="' . get_category_link( $category->term_id ) .  ' >' . $category->name.'</a> ';
    }
    ?>
  5. rossrobbie
    Member
    Posted 4 years ago #

    I pasted that, but now there is no category.
    The place where the category should appear is empty.

  6. rossrobbie
    Member
    Posted 4 years ago #

    There is a link but it gets me to the wrong page- 404

  7. vtxyzzy
    Member
    Posted 4 years ago #

    Sorry, I copied that from another article without testing it. Here is the corrected code:

    <?php
    foreach((get_the_category()) as $category) {
        echo '<a href="' . get_category_link( $category->term_id ) .  '" >' . $sep . $category->name.'</a> ';
       $sep = ', ';
    }
    ?>
  8. rossrobbie
    Member
    Posted 4 years ago #

    I already made it by updating the category-template in wp-includes
    Thanks anyway

  9. vtxyzzy
    Member
    Posted 4 years ago #

    You might want to rethink that because the next upgrade of WP will wipe out your changes.

  10. rossrobbie
    Member
    Posted 4 years ago #

    Any ideas how to make it work for posts` titles?
    Any code to remove the "Permanent link to" stuff.

  11. ddsuresh
    Member
    Posted 4 years ago #

    rossrobbie,

    I think "Permanent link to" might be in your theme, so you need to edit your theme files
    like page.php, archive.php, search.php and manually remove these "Permanent link to"

    Thanks,
    Suresh
    http://www.largeresource.net

  12. rossrobbie
    Member
    Posted 4 years ago #

    I removed the "Permanent link to" text,
    but these "Comments on" "View all posts in" are still appearing
    when mouse hovers the category and comments link bellow the post.

    They are not in the theme`s source code. I've checked everything.
    I guess it's just wrote somewhere in the WordPress'codes.

    I need a specific code that could disable these titles of the links.

  13. rossrobbie
    Member
    Posted 4 years ago #

    I changed my mind.

    The category-comments link below the post are not manually placed there.
    It's used a php script that makes wordpress show them.

    What if instead of deleting manually the title
    we just use another php script that hides the link's title attribute,
    and there will be only the title of the category displaying.

    Do anybody know about that kind of php script?

  14. rossrobbie
    Member
    Posted 4 years ago #

    Any ideas how this code

    <?php
    foreach((get_the_category()) as $category) {
        echo '<a href="' . get_category_link( $category->term_id ) .  '" >' . $sep . $category->name.'</a> ';
       $sep = ', ';
    }
    ?>
    could work for comments?

Topic Closed

This topic has been closed to new replies.

About this Topic