Title: Add text to get_permalink()
Last modified: August 20, 2016

---

# Add text to get_permalink()

 *  [benraaa](https://wordpress.org/support/users/benraaa/)
 * (@benraaa)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/add-text-to-get_permalink/)
 * I would like to add text to the output of the permalink. I have various categories
   and to every category belongs a second “special”-category. So every category 
   should have a link to its own special-category. I thought the solution could 
   be quite easy, something like this:
 * `<a href="<?php echo get_permalink('); ?>-special">Link</a>`
 * But it cuts the permalink off. I tried other variations, but got no result. Is
   there any way to get it solved to add a text on the output?
 * Thanks in advance,
 * benraaa

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/add-text-to-get_permalink/#post-2659547)
 * where are you using that code?
    [http://codex.wordpress.org/Function_Reference/get_permalink](http://codex.wordpress.org/Function_Reference/get_permalink)
 * > it cuts the permalink off
 * the error might be caused by the single quote in the brackets:
 * `(')`
 * unless this was just a typing mistake (?)
 *  Thread Starter [benraaa](https://wordpress.org/support/users/benraaa/)
 * (@benraaa)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/add-text-to-get_permalink/#post-2659592)
 * Yes, sorry, the single quote was a typing mistake. Meanwhile I tried a lot of
   variations: inside and outside the loop, with get_permalink(), the_permalink()
   and post_permalink(), with an echo-command for the text an with variables. It’s
   definitly the wrong way. Now, when I tried it once more, it didn’t cut it off,
   but shows the link of the last article of the category page (now indeed together
   with the “special” text). However I need the link of the category page where 
   I put the code.
 * To make it more clear:
 * code is on category.php,
    last article shown on page “weather” is e.g. “A mix
   of sun and clouds”, link shows [http://www.domain.com/weather/a-mix-of-sun-and-clouds-special](http://www.domain.com/weather/a-mix-of-sun-and-clouds-special),
   but should be [http://www.domain.com/weather-special](http://www.domain.com/weather-special)
 * Is there any other method to get the right link?
 * Hope it’s not too confusing.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Add text to get_permalink()’ is closed to new replies.

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [benraaa](https://wordpress.org/support/users/benraaa/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/add-text-to-get_permalink/#post-2659592)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
