Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter thebejesus

    (@thebejesus)

    Additional query. For some reason the plugin appears to be making sidebars display below post content. This is happening on all posts and pages. The carousel is only displayed on the front page.

    Any ideas?

    Thread Starter thebejesus

    (@thebejesus)

    Found a solution here which I’m not going to pretend to really understand but it works when all other solutions didn’t so I don’t mind.

    I had to tweak the other loops on the site as they ended up kicking out the results of this one but that wasn’t so hard.

    The fix:

    global $paged, $wp_query, $wp;
    if ( empty($paged) ) {
    if ( !empty( $_GET[‘paged’] ) ) {
    $paged = $_GET[‘paged’];
    } elseif ( !empty($wp->matched_query) && $args = wp_parse_args($wp->matched_query) ) {
    if ( !empty( $args[‘paged’] ) ) {
    $paged = $args[‘paged’];
    }
    }
    if ( !empty($paged) )
    $wp_query->set(‘paged’, $paged);
    }
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query(‘paged=’.$paged.’&category_name=Videos&showposts=1′);

    Thread Starter thebejesus

    (@thebejesus)

    One more thing. I changed the get_query_var(‘page’) to get_query_var(‘paged’) and the previous and next buttons all work now. Unfortunately they only work when on a page within the site but it won’t work when that page is set to a static front page.

    Does that suggest anything?

    In case it helps I have it printing the $paged and the max_num_pages variables under the bottom left of the video. When it’s set as a page within the site the $paged variable matches the page number (/front-page/page/3/) but when it’s on the front page it goes to page 2 but $paged remains as 1. Do I need to put an offset in or something like that?

    Thread Starter thebejesus

    (@thebejesus)

    The pagination seems to have the same behaviour on other themes as well. When you tested the code and it worked what conditions were you using? Can you think why it would work (somewhat) as a template set to a static front page and not as the index.php? Is there something there that I could look at?

    Thread Starter thebejesus

    (@thebejesus)

    vinod -> I meant to mention that I’d already found that missing comma so that wasn’t the issue. I’ve added that line to my functions.php but I still seem to have the same behaviour. Is it likely that my hosting would have forbidden disabling of mysql.trace_mode so the function wouldn’t work?

    lordZombi -> When I try that the next_posts_link has the same behaviour (works once) but it serves up the first post on page 2 as well as page 1. previous_posts doesn’t show up.

    For reference this is the index file that is calling the videoplayer template_part. Currently I’ve used the same code as a custom template for a page which I’ve set to a static front page rather than using it as index.php as the previous/next buttons weren’t showing up at all when it was set as the index.

    Forum: Fixing WordPress
    In reply to: Pagination pains
    Thread Starter thebejesus

    (@thebejesus)

    Any thoughts?

Viewing 6 replies - 1 through 6 (of 6 total)