Tagged: x
-
AuthorPosts
-
March 14, 2017 at 4:41 pm #1407157
Hi,
If you check out my page here https://www.topdownreviews.com/los-angeles-immersive-theater-reviews/
You can see that I have 3 grids on that page that are all loading the same thing. The issue I am having right now is that it repeats the first post twice, once as the big image at the top of the page then again in the list of posts below. How do I tell the Grid below to skip the first post?
Thanks for all your help!
ChrisMarch 15, 2017 at 1:36 am #1407629Hello Chris,
The page has one grid only when I check and of course no duplicates.
Although regarding your question, there’s an option to exclude a post. See this:https://theme-one.com/docs/the-grid/ See exclude part. I did attached a screenshot.March 15, 2017 at 2:29 am #1407658Hi,
The exclude a post doesn’t really seem like it would work for me since I have to use a post id to exclude. I don’t want to have to update the id every single time I add a new post. I am looking for a way to automatically exclude the latest post.
Also the page has 3 grids, [the_grid name=”LAimmersivemain”] [the_grid name=”laimmersivemobile”] and [the_grid name=”laimmersivemaintmobile”]. One of them is the big banner image, the other is the mobile big banner image and the final is the grid of images.
Thanks
ChrisMarch 15, 2017 at 10:26 am #1408139Hi Chris,
In that case, it can be achieve using a little custom function. See this thread for guidance:
Change 10 to the number of post you want to bypass.Hope this helps.
March 15, 2017 at 11:31 am #1408250This reply has been marked as private.March 15, 2017 at 11:42 am #1408271nm it seems to be working now!
Thanks
ChrisMarch 15, 2017 at 12:10 pm #1408320Sorry to keep bouncing back and forth, but it that code actually broke something else. When I press the load more button at the bottom of the grid it reloads the same posts over again.
https://www.topdownreviews.com/los-angeles-immersive-theater-reviews/
Thanks
ChrisMarch 15, 2017 at 8:31 pm #1408951Hi Chris,
Try increasing your grid’s Item Number, it’s currently set to 9. Or disable the “load more” feature. There nothing to load at all since you’re displaying 9 items and the limit is 9 (there is no 10th, 11th, etc..)
Or set Item Numbers to -1 to make sure it picks all the post.
Thanks.
March 16, 2017 at 12:08 pm #1409868Hi,
I’m pretty sure the item number displays how many posts are in the displayed grid. There are actually 21 posts in that category but you have to click on the load more button to show more of them. This was working fine until I added the codefunction my_query_args($query_args, $grid_name) { if ($grid_name == 'laimmersivemobile') { // all query parameters can be modified (https://codex.wordpress.org/Class_Reference/WP_Query) $query_args['offset'] = 1; } return $query_args; } add_filter('tg_wp_query_args', 'my_query_args', 10, 2);
to accomplish what I was asking earlier in this thread.
If you check out the grid here https://www.topdownreviews.com/what-to-buy/ you can see how the load more is supposed to work.
What I want to know is how to fix that code above so that it keeps offsetting my first post but doesn’t break the load more button.
Thanks so much!
ChrisMarch 16, 2017 at 8:54 pm #1410537Hi there,
You’re right, looks like the “load more” is sending wrong pagination number. Please change your code to this
function my_query_args($query_args, $grid_name) { if ($grid_name == 'laimmersivemobile') { // all query parameters can be modified (https://codex.wordpress.org/Class_Reference/WP_Query) $query_args['offset'] = 1; if( isset($_POST['grid_page']) ) { $query_args['paged'] = (int) $_POST['grid_page'] + 1; } } return $query_args; } add_filter('tg_wp_query_args', 'my_query_args', 10, 2);
Please provide your FTP login credentials as well so I could troubleshoot it.
Thanks!
March 16, 2017 at 11:17 pm #1410660I added that to my functions but it still doesn’t seem to be working.
Is it working on your end?
Thanks
ChrisMarch 17, 2017 at 2:11 pm #1411359This reply has been marked as private.March 17, 2017 at 3:17 pm #1411429Hi there,
What I need are your FTP login credentials. I can’t just add it through admin, if it breaks or failed in saving then your site will be down.
Thanks!
March 17, 2017 at 4:50 pm #1411526This reply has been marked as private.March 18, 2017 at 3:36 pm #1412290Hi there,
Thanks, it’s stuck with “connecting”. Does it have firewall that blocks users? Please check, and if you have CPanel with file manager then it should be okay than FTP.
Thanks!
-
AuthorPosts