• Resolved MBV

    (@mbv)


    Hi,
    Thanks for the great plugin!

    When using default template with pagination, a bookmark id is added, eg. “lcp_instance_0” which scrolls the page down to the location of the list category posts when the page is loaded.

    However, I’ve noticed a problem when using custom template with the pagination on.
    When using any custom template located in child theme folder, even if it’s exactly the same file template, the bookmark id does not get added for some reason and so the page does not scroll down to the location of the list category post.

    Is it possible for you to verify the bug and find out what might be the issue, please?

    Best regards,
    MVB

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor zymeth25

    (@zymeth25)

    I cannot reproduce this, bookmarks work in templates on my end. Are you running the latest version of LCP?

    Thread Starter MBV

    (@mbv)

    Yes, I’ve just updated to latest version.

    I’ve been able to easily replicate on 3 separate sites.

    Are you sure that you are using a custom template in child theme folder when testing?

    Plugin Contributor zymeth25

    (@zymeth25)

    I had another look, it was a slight misunderstanding because I thought you meant there were no bookmarks in pagination links, which actually are added correctly.

    But now I understand that you meant there were problems with id attributes, not href bookmarks.

    Yes, you are right, ids are not added in custom templates and make bookmarks in pagination links useless. Templates and the whole list building code is going to be refactored soon to solve many problems, including this one.

    For now you can use the following solution: in the default custom template file delete line 47 and paste this code instead:

    $lcp_display_output .= '<ul class="lcp_catlist"';
    
    //Give id to wrapper tag
    if (isset($this->params['instance'])){
      $lcp_display_output .= ' id="lcp_instance_' . $this->params['instance'] . '"';
    }
    
    $lcp_display_output .= '>';

    Let me know if this resolves your issue.

    Thread Starter MBV

    (@mbv)

    Thanks so much, I was able to apply that to my custom template, thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘BUG: Custom template pagination does not scroll to position’ is closed to new replies.