Title: get_permalink to use secondary category
Last modified: August 19, 2016

---

# get_permalink to use secondary category

 *  [soopak](https://wordpress.org/support/users/soopak/)
 * (@soopak)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/get_permalink-to-return/)
 * I’m using a category called “slider” to present articles in a slider at the top
   of my home page. This slider category is used for nothing more than determining
   which articles to display, and all articles are also part of “real” categories.
 * Is there any way I can craft the permalink inside the slider so that the permalink
   uses the “real” categories, instead of the slider category?
 * Current code example below:
 *     ```
       query_posts('category_name='.$queryName.'&showposts='.$numposts);
       while(have_posts()) { the_post();
       echo '<a href="'.get_permalink($post->ID).'">Foo</a>';
       }
       ```
   
 * Many thanks in advance!

The topic ‘get_permalink to use secondary category’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [soopak](https://wordpress.org/support/users/soopak/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/get_permalink-to-return/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
