WordPress.org

Ready to get started?Download WordPress

Forums

Certain css style at active pages (2 posts)

  1. dar3devil
    Member
    Posted 6 years ago #

    Hi. I want to change the css style at the links from Recent Articles widget, so when i'm on a certain page the link to be with a css style called "active". Its something like the links from the pages widget, where says

    if ( !empty($current_page) ) {
    			$_current_page = get_page( $current_page );
    			if ( isset($_current_page->ancestors) && in_array($page->ID, (array) $_current_page->ancestors) )
    				$css_class .= 'active';
    			if ( $page->ID == $current_page )
    				$css_class .= 'active';
    			elseif ( $_current_page && $page->ID == $_current_page->post_parent )
    				$css_class .= 'active';
    		} elseif ( $page->ID == get_option('page_for_posts') ) {
    			$css_class .= 'active';
    		}

    i want to do something like this but for the recent articles. How to do it ?

  2. dar3devil
    Member
    Posted 6 years ago #

    anyone can help?

Topic Closed

This topic has been closed to new replies.

About this Topic