Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Probem with a snippet.

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26452
    Krylo
    Member

    Hi, I know I’m new to this forum, but I’m even NEWER to coding in php/wordpress…

    I’m using one of chris’ snippets specifically the embed a page inside of a page in wordpress:

    Code:
    have_posts()) : $recent->the_post();?>


    I’m using it as an editable sidebar so the client can easily add logo thumbnails to that little section

    the snippet works great, except that when I paginate a section of my site (which is actually a clients site) the second page of the pagination appears in the sidebar instead of the correct page: (Click on page 2 and you will understand).

    http://proofatlanta.com/?page_id=99

    here is what my code looks like:

    Page:

    Code:

    Pages: ‘, ‘after’ => ‘

    ‘, ‘next_or_number’ => ‘number’)); ?>
    Read the rest of this page »

    ‘); ?>

    Pages: ‘, ‘after’ => ‘

    ‘, ‘next_or_number’ => ‘number’)); ?>


    ‘, ‘

    ‘); ?>

    Footer:

    Code:
    have_posts()) : $recent->the_post();?>

    2033 Monroe Dr NE Atlanta, GA 30324 – (404) 892-2359


    I think it has something to do with the location of the end of my loop… but I don’t know enough about php yet to properly trouble shoot. Can someone please help me?

    -Krylo

#65542

I suggest you try setting the sidebar query to always use page 1 by overriding the paged variable:

Code:
$recent = new WP_Query(“page_id=574&paged=1”);

Please give this a try and let me know if that solves it – since I can’t test it myself at the moment.

Cheers,
Dave

#65520
Krylo
Member

Hi, Thank you for the reply!

I tried what you suggested, but it did not work.

could it be that this bit of code is outside of the ‘loop’?

-Krylo

#65521
Krylo
Member

Ok, I figured it out…

I just moved the div thats floating right above the div thats floating left so that it was before the loop…

Thanks for all of the help!

(I’m still learning so bear with me!)

-Krylo :D

#65522

OK, I followed your ‘test’ link again and it seems to be working from my point of view. The ‘Our Locations’ bar shows on all 3 pages of now instead of just on the first page.

Was there some other part of the problem that I didn’t see?

Dave

#65524
Krylo
Member

well I think (as I’m not entirely sure) that it was because the snippet code wasn’t within the loop… so since it was two divs one floating right (the our locations), and one floating left (the main content). I just put the right floating div on top of the floating left div putting it before the loop…

I’m not sure WHY it worked… but so far it seems to have worked… maybe someone can help explain it to me?

and thanks again for your replies dave! :D

-Krylo

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Back End’ is closed to new topics and replies.