WordPress.org

Ready to get started?Download WordPress

Forums

Tag group name replace (1 post)

  1. samcrawshaw
    Member
    Posted 1 year ago #

    I hope you're...
    Hi everyone,

    I'm completely bogaged with (what I assumed would be fairly easy) string replace query.

    I have a bunch of tags that I would like to link to posts rather than tags page. So the url reads:
    url_address/%tag_category_name%/whatever

    instead of:
    url_address/tag/whatever

    Sh/Could I use a string replace with this?

    $tag->term_group outputs the tag category number which I would like to replace with the tag_group_name ($tag->term_group_name is not a valid argument).

    Hope my ramblings make sense to someone out there.

    Thanx for looking,
    Sam

    EDIT: forgot to add my code

    echo bloginfo('url') . '/' . $tag->term_group . '/' . $tag->name;

    to...

    echo bloginfo('url') . '/' . $tag->term_group_name . '/' . $tag->name;

Topic Closed

This topic has been closed to new replies.

About this Topic