MarketPress pagination on WP 3.4

After upgrading to WP 3.4, pagination doesn’t seem to work. When I manually go to /page/2 I get a 404.

Looking at the changes in 3.4, I happened to see this:

Infinite scroll for themes.php and theme-install.php. Bump per page limit for themes.php to 999

Does anyone know how to implement infinite scroll with Marketpress?

And another question:

I couldn’t get pagination to work on the global site. I searched and found other people saying the same thing but some posts say it works, some say it doesn’t… Well does it? I don’t want to try and fix something on my theme if the reason it doesn’t work is not there. :stuck_out_tongue: (By the way, I did try it with marketframe, still nothing).

  • Timothy
    • Chief Pigeon

    Hey there.

    With regards to the 404, often that is a permalink or htaccess issue.

    Can you checked your htaccess is still good?

    Then resave your permalinks and also your presentation tab:

    Admin –> Products –> Settings –> Presentation [tab]

    Let me know how that works out.

    Take care.

  • aristath
    • Recruit

    .htaccess seems ok…

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
    AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
    AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
    AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
    AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
    AddOutputFilterByType DEFLATE font/truetype font/opentype
    </IfModule>

    <files wp-config.php>
    order allow,deny
    deny from all
    </files>

    The pagers are set correctly on my admin pages, I can see them on the frontend but when clicking on them I get the 404

  • aristath
    • Recruit

    @aecnu Hello there!

    My istallation was a bit messed-up as @Timothy told me so I re-istalled everything to clean things up. However, the problem still existed so I did the following:

    In marketpress/marketpress-includes/template-functions.php

    lines 1351-1357 are like this:

    $content .= '</div>';

    if ($echo)
    echo $content;
    else
    return $content;
    }

    Change that to this:

    $content .= '</div>';
    if ( $wp_query->max_num_pages > 1 ) :

    $content .= '<ul class="pager" style="clear: both; float: none;">';
    $content .= '<li class="previous">'.get_previous_posts_link('Previous').'</li>';
    $content .= '<li class="next">'.get_next_posts_link( 'Next').'</li>';
    $content .= '</ul>';
    endif;

    if ($echo)
    echo $content;
    else
    return $content;
    }

    That’s of course assuming that on your theme’s mp_productlist.php there’s a line that calls on the function mp_list_products like this:

    <?php mp_list_products();?>

    If there’s another function being called in that file then you’ll probably have to look up that function in your theme’s functions.php and make the appropriate adjustments.

    If on the other hand there’s no such file in your theme then the above “hack” will do the trick.

    The optimal solution would be to copy that function to your theme’s functions.php (lines 1239-1357 of the template-functions.php file), rename it to something like mytheme_list_products and then call on that function in your theme’s mp_productlist.php file like this:

    <?php mytheme_list_products();?>

    This way you won’t have to hack marketpress core and you’ll be able to update it when an update comes out without having to re-apply the hack.

  • aecnu
    • WP Unicorn

    Greetings aristath!

    Howdy Ho there my neighbor to the South (Wondering yet? I am in Sofia)

    Thank you so much for getting back to me on this issue and ticket so quickly, it is greatly appreciated and I truly appreciate you sharing your fix with us and your detailed explanation.

    Wow! Some well deserved rep points sent your way!

    Cheers, Joe

  • aristath
    • Recruit

    Hello there neighbor to the North! (and I was just about to ask you why you always call me “neighbor to the South”… )

    Thank you for the rep points, greatly appreciated!

    A side-note on the above fix: My choice of using

    <ul> <li> elements and the classes added to them are just for theming purposes because I’m using bootstrap.

    You can easily change those to divs, spans or whatever suits your theme’s needs.

    P.S. Why is it that I don’t see people using the “share my location” feature of this forum?

    Cheers, Aris

  • Ella
    • The Incredible Code Injector

    Hi Aristath,

    I am still struggling with my pagination.

    see post https://wpmudev.com/forums/topic/pagination-5#post-241161

    Put in the code at line 1351-1357 what you suggested… but no pagination.

    I’m using the plugin for grid view 0.3. When I understood it good, that will do the same as the short code mp_list-products.

    Please can you help me… and please keep it simple :slight_smile:

    I adore short sentences, that I can understand.

    Ella

  • aecnu
    • WP Unicorn

    Greetings aristath,

    Good afternoon to you my neighbor to the south!

    Why is it that I don’t see people using the “share my location” feature of this forum?

    Thank you for this great question. In my specific case I can honestly say that my browsers do not allow me to and I am using Firefox 13.0.1 and also IE9 of course since they are the most widely used.

    I tested this with the lead developer and we suspect it is some security setting in my computer somewhere that is not allowing it, firewall, something.

    Also some browsers do not allow Geo location disclosure or more accurately do not recognize Geo location.

    Cheers, Joe