• i created a template page to show a category in my site using this tutorial http://antbag.com/create-a-category-page-template-with-the-twenty-eleven-theme/

    my site is a renamed copy of twenty eleven folder so im not editing the original folder

    the problem is when i create a page and try to select the new template at “page atributes” – template options, the new template name i created is not there as an option.. i can only select “default template”, “category tutorials”, “showcase template” and “sidebar template” ..

    shouldnt this new template page appear here as an option to select ?

    what im doing wrong ?

    this is my site http://www.connectto.com.br/websites/

    the template page i created is named category-portfolio.php

    in it id like to show only the posts from portfolio category which i created in my wordpress admin..

    anyone can please help ?

    if more info is needed, just tell me and i can try to found here

    sorry about my bad english

Viewing 7 replies - 1 through 7 (of 7 total)
  • the template page i created is named category-portfolio.php

    probably a tricky name as this interferes with the default template hierachy naming convention for custom category archive templates; http://codex.wordpress.org/Template_Hierarchy#Category_display

    what Template Name: have you added at the start of the template?
    http://codex.wordpress.org/Page_Templates#Custom_Page_Template

    did you upload the new template into the folder of your theme?

    you should be able to find the new template in the list on the right, under:
    dashboard – appearance – editor
    when your theme is seleted at the top right.

    Thread Starter connectto

    (@connectto)

    yes i uploaded the file to the theme folder

    yes alchymyth you are right, i found the error – the template name was wrong. thanx !

    now the only problem i have is that the page portfolio opens but dont show the category posts

    following the tutorial which i mentioned , it says to use the code

    <?php $archive_query = new WP_Query('cat=7&showposts=1000');
    	while ($archive_query->have_posts()) : $archive_query->the_post(); ?>

    changing the number 7 with my category id numeber – which i found its the number 3

    i changed this , and my portfolio page is like this http://www.connectto.com.br/websites/portfolio/

    it shows a list with the post titles, but dont show the post images, its not correct at all.. the background isnt expanding with the content… still with something wrong ?

    is there any different way to do that ? show all posts from a category in this page .. actually as all my posts are just from one category in this site, i want my portfolio page to be like my home page http://www.connectto.com.br/websites/

    alchymyth , really thanx for your help – hope this is my last question hehe, thanx for your excelent work !

    can you post he full code of the template?

    please use the pastebin, http://codex.wordpress.org/Forum_Welcome#Posting_Code

    Thread Starter connectto

    (@connectto)

    right now, this is the line (line 48 in the pastebin) that creates the output for each post:

    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></li>

    as you can see, this just outputs the linked title.

    you could try and replace that line with:

    <li>
    <?php get_template_part( 'content', get_post_format() ); ?>
    </li>

    that would create the same output per post as any other archive page in Twenty Eleven.
    (not tested for layout effects when this is used in an unordered list)

    the question is:
    do you use the unordered list on purpose?

    Thread Starter connectto

    (@connectto)

    no, i dont even know whats “unordered list” actually – i just found this example tutorial and did the same in my page

    now the posts are visible, but the background still with error – what make me think – im i doing this in a totally wrong way ?

    http://www.connectto.com.br/websites/portfolio/

    i mean – i see its working now, but , its not similar to my homepage – with background , pagination, etc…

    id like to have an internal page (portfolio) that show category portfolio posts in the same way my home page does .. with all details, bg, pagination, images etc..

    then i will make a diferent homepage without posts

    am i doing the wrong way ?

    Thread Starter connectto

    (@connectto)

    is there a better way to do this ? or should i keep editing this page (as im doing with your heklp – thanx) and it will be ok ?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘template page to show category – twenty eleven’ is closed to new replies.