WordPress.org

Support

Support » Themes and Templates » page w/ posts – pagination – twenty eleven

page w/ posts – pagination – twenty eleven

Viewing 3 replies - 1 through 3 (of 3 total)
  • your chosen file name category-portfolio.php might get interpreted by the template hierarchy as a category template; http://codex.wordpress.org/Template_Hierarchy

    basically, you are telling your template to show a 1000 posts per page:

    <?php $archive_query = new WP_Query('cat=3&showposts=1000');

    http://codex.wordpress.org/Class_Reference/WP_Query
    http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters

    start by changing that to 4, and then add the ‘paged’ parameter; example:

    <?php $archive_query = new WP_Query('cat=3&posts_per_page=4&paged='.get_query_var('paged'));

    then review:
    http://codex.wordpress.org/Pagination

    for example, add some code like this in line55 of the pastebin code or after the endif of the loop (might need added html for formatting reasons):

    <?php previous_posts_link('« Newer Entries', $archive_query->max_num_pages); ?>
    <?php next_posts_link('Older Entries »', $archive_query->max_num_pages); ?>

    (untested)

    ok alchymyth, thanx for your help, really , dont know other place to learn this stuff !

    so i changed the number from 1000 to 4, and also change my page number to portfolio.php .. also change the template name from category-portfolio to `Template Name: portfolio

    and added the pagination code at the end

    but now my background works but the posts from my category called “portfolio” disapeared ..

    thats the problem, and thats why i thought i should call this page category-portfolio … because i need to show the posts from this category in this page..

    so

    it would help me a lot now know how is the correct way to show my posts from category “portfolio” and background, pagination, etc , without mess with the wordpress template hierarchy using the name category-portfolio.php .. just need to know that hehe

    i have some problem to understand correctly this wordpress texts about their structure and how it works… im not a professional programmer and also my english is little poor .. i understand the text but it dont give me ideia about how to put this in the codes …

    thanx for your help

    sorry just forget to say

    u can see how it is right now here http://www.connectto.com.br/websites/portfolio/

    and heres the code http://pastebin.com/BHTzr06u

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘page w/ posts – pagination – twenty eleven’ is closed to new replies.
Skip to toolbar