Forums

Page Links To redirect page not assigned current_page_item (5 posts)

  1. danbranigan
    Member
    Posted 2 months ago #

    I’m using the 2.1 version of this plugin with Wordpress 2.8.4 but the

  2. that contains the redirected page link in my menu isn’t picking up the “current_page_item” class. I’m pretty sure that in the “versions” list for this plugin above the author says that “If you link to an internal WordPress page, like a category, the menu item will get the current_item CSS class when you’re on that page”.
    Any ideas? Cheers, Dan.
  3. http://wordpress.org/extend/plugins/page-links-to/

  • maorb
    Member
    Posted 1 month ago #

    I'm also having this problem, just was about to submit a ticket.
    Will be very happy for ideas how to solve this, or to other plugin that does the same job and don't have this bug.

    Thanks

  • Gleasonator
    Member
    Posted 1 month ago #

    Just downloaded and installed this... I noticed this as well. I'm bumping this up since it's also something that I'd like fixed as well.

    Thanks,
    Alex

  • ZackAjmal
    Member
    Posted 1 month ago #

    I have the same issue.

  • ZackAjmal
    Member
    Posted 1 month ago #

    I have figured out the problem.

    In page-links-to.php, lines 178-181 are:

    if ( $highlight ) {
    	                $pages = str_replace( ' class="page_item current_page_item"', ' class="page_item"', $pages );
    	                $pages = str_replace( '<li class="page_item"><a href="' . $current_page . '"', '<li class="page_item current_page_item"><a href="' . $current_page . '"', $pages );
    	        }

    Replace them by:

    if ( $highlight ) {
                    $pages = preg_replace( '/ class="page_item page-item-(\d+) current_page_item"/', ' class="page_item page-item-$1"', $pages );
                    $pattern = '|<li class="page_item page-item-(\d+)"><a href="' . $current_page . '"|';
                    $replacement = '<li class="page_item page-item-$1 current_page_item"><a href="' . $current_page . '"';
                    $pages = preg_replace( $pattern, $replacement, $pages );
            }
  • Reply

    You must log in to post.

    About this Topic

    Tags