WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: jQuery-Pagebar] Problem with URLs (2 posts)

  1. scribu
    Member
    Posted 5 years ago #

    In jQuery-Pagebar 0.3.2.1, when you have an URL like this:

    http://example.com?something=foobar

    the plugin creates this URL:

    http://example.com?something=foobar?paged=5

    which should be

    http://example.com?something=foobar&paged=5.

    There is a simple fix that should solve this problem for good:

    In jquery_pagebar.php,

    find this code (line 148):

    if(get_option('permalink_structure') != "") {
    
    	if (is_search()) {
    
    		$loc_href =  '\''. $url .'&paged=\'+ ui.value ;';
    
    	}else {
    
    		$loc_href =  '\''. $url .'?paged=\'+ ui.value ;';
    
    	}
    
    } else {
    
    	if (is_search() or is_archive()) {	 
    
    		$loc_href =  '\''. $url .'&paged=\'+ ui.value ;';
    
    	} else {
    
    		$loc_href =  '\''. $url .'/?paged=\'+ ui.value ;';
    
    	}
    
    }

    and replace it with this:

    if ( false === strpos($url, '?') )
    	$loc_href =  '\''. $url .'?paged=\'+ ui.value ;';
    else
    	$loc_href =  '\''. $url .'&paged=\'+ ui.value ;';

    http://wordpress.org/extend/plugins/jquery-pagebar/

  2. Thx for your code, it should be fixed with 0.3.2.2.

Topic Closed

This topic has been closed to new replies.

About this Topic