Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The category filter won't work in portfolio with pagination #1

Open
01Kuzma opened this issue Feb 21, 2021 · 0 comments
Open

The category filter won't work in portfolio with pagination #1

01Kuzma opened this issue Feb 21, 2021 · 0 comments

Comments

@01Kuzma
Copy link

01Kuzma commented Feb 21, 2021

The category filter won't work in portfolio with pagination enabled.
Once you have many posts and use pagination - it simply filters posts from a current pagination page, not from all available posts.
Just add some more posts with different categories (or lower the posts per page) and add pagination:

    <div class="blog-pagination">
    	{% if posts.lastPage > 1 %}
    		<ul class="pagination">
    			{% if posts.currentPage > 1 %}
    				<li><a href="{{ page.baseFileName|page({ (pageParam): (posts.currentPage-1) }) }}">&larr; Prev</a></li>
    			{% endif %}
    
    			{% for page in 1..posts.lastPage %}
    				<li class="{{ posts.currentPage == page ? 'active' : null }}">
    					<a href="{{ page.baseFileName|page({ (pageParam): page }) }}">{{ page }}</a>
    				</li>
    			{% endfor %}
    
    			{% if posts.lastPage > posts.currentPage %}
    				<li><a href="{{ page.baseFileName|page({ (pageParam): (posts.currentPage+1) }) }}">Next &rarr;</a></li>
    			{% endif %}
    		</ul>
    	{% endif %}
    </div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant