• Hi,

    I’ll start off by saying I’m completely new to WordPress. I’ve been playing around with it for about 2 days and I LOVE it =)

    I use WP more like a portfolio than a blog. In WP you write either a post or a page. A page is intended for “timeless” or even static content, and a comment is posted as an event to one or more categories, like a blog.

    I wanted to create pages with a little introductory text, and then “post” my (new) work / projects on those pages. I searched this forum looking for answers and found some statements like “you don’t post on a page in WP, period” and “posts are posts and pages are pages”.

    After a little hacking around with page templates I’m happy to say this is simply NOT TRUE. I wanted to clear this up for anyone who likes to use WP as a website/portfolio instead of mainly a blog.

    Note: Basic knowledge of php is required. You’ll have to dig into the theme code, but only a tiny bit…

    (using the default/kubrick template)

    1) create a page template by copying the default “page.php” and adding at the top:
    <?php
    /*
    Template Name: YourTemplateName
    */
    ?>

    this will make it show up in the templates menu as “YourTemplateName” when you edit/write a page.

    2) In the template, create a second (empty) content section right underneath the existing one like this:

    <div id=”content” class=”narrowcolumn”>

    </div>

    3) Query the post(s) you want to add to your page by putting a query_post() at the top of your new content section:

    <?php query_posts(‘category_name=myWork’); ?>

    For example this line will simply query all the posts that are listed under the “myWork” category, but you can do whatever you like really. Check the docs.

    4) Copy the “while” loop from archive.php and add it under the query statement. This will display the posts, looking the same as in your blog archive.

    5) Create a new page, and assign the template to it.

    That’s it! You can then tweak this “while” loop the way you want it to look. For example I wanted to display the post more like plain text paragraphs, so I removed the bottom line which shows the categories and allows people to comment and edit.

    Its all up to you. You make the rules.

    HTH Cheers,
    Thijs

Viewing 5 replies - 1 through 5 (of 5 total)
  • And why isn’t easier to use Category_Templates – if all you wanted is to display posts from one category with a different layout? Just wondering…

    Thread Starter 0x80

    (@0x80)

    The main advantages over category templates I can think of:

    – no static page content in your php file. You edit the static text with images and whatever like you do with regular pages.

    – full control over what posts to display. Maybe you want to combine posts from different categories, make a “my favorite projects page”.

    You could probably do the same with category templates, but that would be really confusing. You click on a category, and what you get is not really a category…

    – Give your templates sensible names, instead of using the category id number. It also allows you to easily assign /switch different templates in the page management instead of overwriting category-6.php with a different category-6.php

    Like I said I’m new to WP and still discovering how I can use it the way I want. I like how flexible the page template approach is, but I guess a lot of it comes down to personal preference.

    Cheers

    I searched this forum looking for answers and found some statements like “you don’t post on a page in WP, period” and “posts are posts and pages are pages”.

    Well, it is true, and you even prove the point.
    The cool thing about using posts for your projects is the way you can organize them, search them, tag them, categorize them etc. This lets you then create a cooler portfolio than using Pages.
    What I need WordPress to do is add some media-functions. I’d like to switch my company site from manual CMS to WP, but we have a list of a few hundred Speakers with audio samples … I guess I need to start learning how to write plugins.

    Thanks for the post, it’s amazing to see what you can do with WordPress, how the same CMS powers the blandest of Blogs as well as very large business sites. I agree, it is a great system, and learning the ropes is easy as well as rewarding.

    Thread Starter 0x80

    (@0x80)

    Well, it is true, and you even prove the point.

    Ehm… no it’s not, and I don’t see how I possibly prove the point either. I didn’t intend this to replace categories and tags and how all that’s used in a more traditional way. My website still uses all those features as well, since it is obviously useful in a lot of ways. I’m just illustrating an alternative / additional way of structuring a page.

    Maybe I missed it, but nobody seemed to answer the question. How do you post to a page you just created?

    Thanks,

    The_User

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Post on page. Portfolio style’ is closed to new replies.