Custom category/archive template for portofolio posts in wordpress

  • Unknown's avatar

    I want to assign custom template to Portfolio Archives/Categories, to show posts in different style (like in Grids) instead of wordpress traditional post category/archive style.

    I’ve tried to create another archive-portfolio.php & category-portfolio.php and give them different style to show posts. Even i also have tried by following code to get custom template for custom_post_type category/archive.

    Here is the code;


    if ($wp->query_vars["post_type"] == "portfolio") {
    include(TEMPLATEPATH . "/category-portfolio.php");
    echo 'This is Portfolio';
    } else {
    include(TEMPLATEPATH . "/category-post.php");
    echo 'This is Single Post';
    }

    But in either both ways it doesn’t show custom template. I’m little confused here. Please help. thanks

  • Unknown's avatar

    You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.

    If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.

    This is an automated message.

  • The topic ‘Custom category/archive template for portofolio posts in wordpress’ is closed to new replies.