New Landing How can we help? Themeforest Theme Support Punch Issue with Portfolio Pagination

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Punch
  • #8034
    koconder
    Member

    Hi there, Great theme but many hacks need to be done to get the portfolio section to work as it should past 8+ items. I have changed the query to return all posts but its not using pagnation and filtering properly as it should (as one would intend it to work like).

    Original Snippet from /includes/sf-functions.php

    // PORTFOLIO QUERY SETUP
    global $post, $wp_query;
    if ( get_query_var('paged') ) {
    $paged = get_query_var('paged');
    } elseif ( get_query_var('page') ) {
    $paged = get_query_var('page');
    } else {
    $paged = 1;
    }
    $portfolio_args=array(
    'post_type' => 'portfolio',
    'post_status' => 'publish',
    'paged' => $paged,
    'portfolio-category' => $category_slug,
    'posts_per_page' => $item_count
    );
    $portfolio_items = new WP_Query( $portfolio_args );
    $count = 0;

    My Modified Version

    // PORTFOLIO QUERY SETUP
    global $post, $wp_query;
    if ( get_query_var('paged') ) {
    $paged = get_query_var('paged');
    } elseif ( get_query_var('page') ) {
    $paged = get_query_var('page');
    } else {
    $paged = 1;
    }
    $item_count = -1;
    $portfolio_args=array(
    'post_type' => 'portfolio',
    'post_status' => 'publish',
    //'paged' => $paged,
    'portfolio-category' => $category_slug,
    'posts_per_page' => $item_count
    );
    $portfolio_items = new WP_Query( $portfolio_args );
    $count = 0;

    #8476
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi there,

    This is most likely a plugin conflict, or something wrong in your setup, as it works perfectly for us, as seen on our demo.

    Do you have any plugins enabled?

    – Ed

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register