Title: CSS Active Link
Last modified: August 19, 2016

---

# CSS Active Link

 *  [jbeltran](https://wordpress.org/support/users/jbeltran/)
 * (@jbeltran)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/css-active-link/)
 * Hi,
 * I currently have a navigation generated by the wp_list_pages function. I coded
   the CSS such that the active page link has a different text format than other
   nonactive links. This work fines, except for the Search results page – whenever
   I’m on this page, the Posts page link becomes active. Is there a way I can make
   this inactive and only active when I’m actually on the Posts page?
 * Hopefully this makes sense!
 * Thanks

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

 *  Thread Starter [jbeltran](https://wordpress.org/support/users/jbeltran/)
 * (@jbeltran)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/css-active-link/#post-1189828)
 * I just realized this also applies to the 404 page. I guess wordpress recognizes
   these as posts?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/css-active-link/#post-1189829)
 * Both – from what I can see. Using `<div <?php post_class();?>>` results in ‘<
   div class=”post- hentry page”>`
 *  Thread Starter [jbeltran](https://wordpress.org/support/users/jbeltran/)
 * (@jbeltran)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/css-active-link/#post-1189838)
 * Hi Esmi,
 * I’m not sure what you mean by the post_class() in div. I’m generating the navigation
   by wp_list_pages function…
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/css-active-link/#post-1189840)
 * Just pointing out that the search results and 404 pages are classed as both posts
   and pages.

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

The topic ‘CSS Active Link’ is closed to new replies.

## Tags

 * [active link](https://wordpress.org/support/topic-tag/active-link/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/css-active-link/#post-1189840)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
