• Hi
    I have installed wordpress and read *a lot* of documentation on codex. My requirement is as follows

    I need to create a personal website (blogging may not be a part of it). What is what is that I can submit content to wordpress and tag each content with a flag (you can say assign a category to it). After doing so I intend to write my own theme such that for each page on my website I can get content based on the category and generate pages (as per my style).

    To illustrate the point I need to create a page that list all the projects I had worked on. I would then submit all my project (each as a single unit of information) to the wordpress where the title would be the title of the project and the content would be the description of the project
    I would the like to creat a this page dynamically by writing a file projects.php in which I can like to iterate over all the projects and list as per my layout.

    I thought one way to do that would be to have individual post for each project each tag with a category “project”. That way by clicking on the indvidual category I can list all my projects. But I don’t know how this would work if I want to keep the page password protected.

    Is there a better way of doing this using pages. Moreover in page.php file I see “The Loop” but does it ever go beyond the first iteration.

    Thanks,
    Sumit

Viewing 5 replies - 1 through 5 (of 5 total)
  • Okay, you got so many things you want, it’s hard to figure it all out.

    1. You want password protected pages.
    2. You want to generate a different “look” (style) per category.
    3. The category list will be on a pseudo static Page you want to call projects.php or whatever.

    Until we get better clarification on ALL these different things, and right now, I think a static website might be a better idea than a PHP generated one as it will give you much more fine-tune control over what looks like what, or a solid CMS system.

    Here are some resources you might have missed:

    https://codex.www.ads-software.com/The_Loop_in_Action
    https://codex.www.ads-software.com/Stepping_Into_Templates
    https://codex.www.ads-software.com/Category_Templates
    https://codex.www.ads-software.com/Template_Hierarchy

    Thread Starter sumitr

    (@sumitr)

    Hi
    I read all the links that you suggested. Let me ask specific question as I think that would be quicker.

    Does the look in page.php ever go beyond one iteration. For e.g my page.php has these lines

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h2 id=”post-<?php the_ID(); ?>”>
    <?php endwhile; endif; ?>

    Could there be a case when <h2 id=”post-<?php the_ID(); ?>”> is executed twice i.e. the loop iterates more than one. ( For posts it does but will it ever iterate for “Pages”

    Thanks,
    Sumit

    Why would you need that? I mean to show more than one Page-content on it?

    I think you’d better stick to your idea about categories. Then you can have all items (posts) in that category show up on one page.

    I have never used password-protected pages myself (apart from the admin interface of course), but I’m pretty confident you can make that work. WordPress is quite flexible if you use some creative thinking (and a bit of extra coding can work miracles)…

    Thread Starter sumitr

    (@sumitr)

    I will give a simple example to explain why I need this

    Suppose I divide all my content into 10 blocks – C1,C2 … C10

    Now I want to display these content on three pages such that
    page 1 contains C1,C2,C3
    page 2 contains C4,C5,C6
    and page 3 contains C7,C8,C9,C10 and page 3 is password protected

    Using Post
    ————–
    The only way I could figure out to do this is to have all C1…C10 as individual posts and three categories page1, page2, page2. So while creating the post I can assign them to appropriate category. The problem occurs with the password protected page. A user has to type in password for each of C7, C8,C9,C10 to see the page completely

    Using Pages
    —————-
    I don’t know if there is a way to do the same with Page (post_status=”static”). I was wondering if I can do the same with pages so my previous question of iterating over pages.

    Q1: Is there a better way to do it?

    Q2: However if it is possible to password protect categories too, then the above would be quite easy. I see there isn’t any such field in wp_categories. Any pointers to where in the code should I look around to add this functionality?

    Q3: Is it possible to iterate over all the posts from within a Page (static page) i.e database entries with post_status=publish? It seems that when one click on the any static page link eventually wp-blog-header.php is invoked with a page_id=<number> argument that restricts the result of the sql query by adding the appropriate where clause.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Tweaking WordPress for personal website’ is closed to new replies.