-
AuthorPosts
-
June 10, 2020 at 1:50 pm #1221190
Hi there,
I have a portfolio grid (which I will use multiple times) and want it in one row with pagination, but when I click on page 2 it goes to the top of the page)
I have looked into the issue in support/forum and tried:
https://kriesi.at/support/topic/link-to-next-page-when-using-portfolio-grid-in-enfold-one-page-website/
in combination with:
https://kriesi.at/support/topic/portfolio-pagination-link-to-id-works-wrong/But all it does is not make pagination work at all.
June 16, 2020 at 2:05 pm #1223028Hey Frank,
Sorry for the delay. Did you replace the ID in the snippet with the ID of the color section containing the blog posts or pagination?
var news = $('#transaksjoner'),
If the posts element is not inside a color section yet, try to move it inside one, then apply a unique section ID to the color section. You’ll find the Custom ID Attribute field in the Advanced tab of the color section. After defining the ID (e.g “custom-section”), go back to the script or snippet, look for the same line mentioned above and replace the selector with the custom ID.
var news = $('#custom-section'),
Best regards,
IsmaelAugust 11, 2020 at 10:45 am #1236636Hello,
I’ve tried to get this to work on my site too. But no luck, I don’t know what I’m doing wrong.
There a color section with and ID, there’s the script in my functions.php file. (I’m using a child theme)
But there’s still a page reload that stays at the top of the page instead of going to the anchor.August 13, 2020 at 3:59 am #1237221Hi,
@Tom: Where did you add the element with the pagination? We found one in the home page but it’s using the AJAX pagination instead of the default one. Site looks good by the way.
Best regards,
IsmaelAugust 13, 2020 at 9:56 am #1237316Hi Ismael,
That’s odd. The element I’m talking about is still there.
The pagination is the 1 – 2 – 3 at the bottom of it, and it opens a new page, not AJAX. Once you click on the image it opens the AJAX portfolio, but also there the arrows don’t seem to work. I’m 100% sure I’m using a portfolio grid element, in the special one column mode with pagination and AJAX portfolio preview.August 17, 2020 at 5:05 am #1238345Hi,
@Tom: Sorry I missed the pagination in the #recentecases container. Try to add this script in the functions.php file.
function add_custom_script(){ ?> <script type="text/javascript"> (function($){ function b(id) { $('.pagination .inactive').click(function(e) { e.preventDefault(); var section = $(id), link = $(this).attr('href'), anchor = $(section ).attr('id'); if(!section.length) return; var link = link + '#' + anchor; window.location.href = link; }); } $(document).ready( function() { b('#recentecases'); }); })(jQuery); </script> <?php } add_action('wp_footer', 'add_custom_script');
Best regards,
IsmaelAugust 17, 2020 at 9:27 am #1238427No worries Ismael,
Thanks for the code, but it doesn’t seem to be working at all. Deleted browser cache, changed to another browser…
August 19, 2020 at 4:42 am #1238994Hi,
Thank you for the update.
The code is there but for some reason it’s not taking effect. We might have to wait for the document to be ready before executing the function. We adjusted the code a bit. Please try it again.
We just changed this line:
$(document).ready( function() { b('#recentecases'); });
Best regards,
IsmaelOctober 5, 2021 at 6:29 pm #1323682Have the same problem and I did NOT resolve with your code.
Maybe I miss something.
I have one page website with a anchor link to the #referenze (in my website) and inside this block I have the portfolio grid when I click on the second page go to the ?avia-element-paging=2 and unfortunately to the top of the page.I try the different code that I found in the forum but for sure I miss something, can you maybe post exactly how to fix.
Can you help please?
October 6, 2021 at 10:58 am #1323744Hi,
@wj5: Did you apply a unique ID to the section containing the posts element? In the previous example, the name of the section containing the element with the pagination is “recentecases”, so we used function b and place “#recentecases” as the value of the id parameter.b('#recentecases');
Best regards,
IsmaelOctober 6, 2021 at 2:33 pm #1323769Yes I include the personal ID name that for me is : b(‘#referenze’);
October 7, 2021 at 5:17 am #1323840 -
AuthorPosts
- You must be logged in to reply to this topic.