• Good morning,

    I’m working on a french cooking recipe site. I use a lot of categories to classify the recipes. The site looks pretty good, but I have some trouble regarding the ‘previous entries link’ only for displaying the page #1: the ampersand & is replaced by #038;, and causes a wrong page 1.

    Here after the code:

    * First I do a dedicated menu to access different cook recipes, using a plugin php file:
    Eg. menu item code for displaying appetizers :
    echo '<li><a href="' . get_category_link($cat->cat_id) . '?appetizer=true&catmenu='.$cat->cat_id.'" title="See all appetizers" rel="category tag">appetizers</a></li>';

    * Then the template ‘category.php’ file will filter the output, with the defined ‘apetizer’ :
    `
    <?php if ( isset($_GET['apetizer']) ){?>
    <h4>The appetizers</h4>
    <?php query_posts('cat=20&paged='.$_GET['paged']); ?>

    </code>
    
    This works for all next entries link, eg:
    http://www.regimesante.fr/index.php/category/regime/regime-seignalet/?plat=true&catmenu=8&paged=2
    
    but not for the previous entries link to the page 1 (replacing &catmenu by #038;catmenu):
    http://www.regimesante.fr/index.php/category/regime/regime-seignalet/?plat=true#038;catmenu=8&paged=1
    
    I've found that the conversion is done into the wp-include/link-template.php at line 440
    <code>

    $qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_option('home') ) . $qstr );
    `

    If I remove #038; from that line, the link works, but I don’t wish to modify the wordpress kernel source files.
    Please, how could I avoid the #038 conversion ?

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘previous entries link modified with #038; instead &’ is closed to new replies.