Forums

[resolved] Tags Problem (4 posts)

  1. ilkaysx
    Member
    Posted 2 years ago #

    Hi;

    Firstly, my english is very bad :) I'm sorry..

    I'm trying to explain my problem.

    I'm adding tags.

    Sample tag: "prison break"

    It has been: "http://www.domain.com/tag/prison-break"

    But, that is happening: "http://www.domain.com/tag/prison break"

    There is space between two words.

    I found that inside single.php:

    <?php if($tags != "") { foreach($tags as $t) {?> <a href="<?php bloginfo("url");?>/tag/<?php echo $t->name;?>"><?php echo $t->name.",";?></a>  <?php } }?>

    Can you help me?

    Thank you for your help.

    Once again, sorry for my English.

  2. Devin Price
    Member
    Posted 2 years ago #

    Try replacing that with just: <?php the_tags(); ?>

    http://codex.wordpress.org/Function_Reference/the_tags

  3. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    alternatively:
    try and use 'slug' instead of 'name' in your link code:

    <?php if($tags != "") { foreach($tags as $t) {?> <a href="<?php bloginfo("url");?>/tag/<?php echo $t->slug;?>"><?php echo $t->name.",";?></a> <?php } }?>

    http://codex.wordpress.org/Database_Description#Table:_wp_terms
    http://codex.wordpress.org/WordPress_Taxonomy

  4. ilkaysx
    Member
    Posted 2 years ago #

    I tried both ways. Problem solved.it's wonderful.Thank you for everything.

Topic Closed

This topic has been closed to new replies.

About this Topic