last day (18 days later) » 

6:42 PM
1
A: post loop is repeating same post

mr.voidI think u would like do something like this: echo '<div class="row">'; $i = 0; while($the_query->have_posts()) { $the_query->the_post(); if($i % 3 == 0){ echo '</div><div class="row">' } <div class="col-md-4"> ... </div> $i++; } echo '</div>';

 
So if I were to put this code into my code above how would it look? Everytime I tried putting everything together I just got a blank page.
 
Its pseudocode. If u add a ; at the end of this line "echo '</div><div class="row">'" and wrap the "<div class="col-md-4">" and "</div>" with php echo statements it should be fine. "Everytime I tried putting everything together I just got a blank page" - you should adjust the error reporting settings, so php prints errors etc.
try this one: pastebin.com/gREzQm9L
 
Thank you! I'm still not the best at php. The code you provided worked, however the posts are showing up one in a row, not three. How can I make it so it will be three posts in a row?
 
if($i % 3 == 0){ echo '</div><div class="row">' } , should do this job, idk why is not working for you
Oh i know why ... i had a mistake in the code: pastebin.com/UGVjvcXD
 
Awesome, works great. Thank you! There is one more issue if your still willing to help. The load more button doesn't appear (in your first code and second)
 
6:42 PM
maybe get_query_var('paged') is bigger or same as $the_query->max_num_pages
 
The load more button should work. I also use this button on my home page, and everything works good. Is there anyway it's in the wrong spot in the code?
 
you dont see or it not works?
its a difference
 
I don't see it at all.
 
yeah this could in cause of that the value you get from get_query_var('paged') is bigger or same as the value of $the_query->max_num_pages.
do an
echo get_query_var('paged').' ::: '.$the_query->max_num_pages;
on you page
and compare the values you get
 
where should I paste this code?
 
6:53 PM
take this
 
It says 0::::3
and I also have posts_per_page set at 3
 
mh ... so based on these values the load more button should be shown
u have a clue whats happend in load_more_button function?
 
I'm using this plugin for it - wordpress.org/plugins/easy-load-more
But like I said before I'm also using it for my front page and the load more button works fine.
Here is how it is used on my front page
 
is the page online?
can i view?
 
7:09 PM
no i mean the renderd page
something like
yourwebsite.com
 
No it is not, I have it on a local host
 
mh sorry, i cant help then
 
Thank you anyway!
 
NP
 

  last day (18 days later) »