WordPress.org

Ready to get started?Download WordPress

Forums

Complex Page Layout (or not) (4 posts)

  1. rodrigogalindez
    Member
    Posted 6 years ago #

    Hello guys,

    I'm making a complex layout (at least for me) in WP. What I want is a certain page as the homepage of WP. This page will have a custom template for managing this:

    1. The current page content. It's the blurb for what the client is selling.
    2. Featured Work. It's a post from a certain cat (say, cat 3). I will just load the excerpt of the post, that field will contain a little thumb of the project, the title and description.
    3. Blog. All posts from a certain cat, say, cat 5.
    4. Sections for that specific page. I'm thinking on implementing sub pages for this; i.e. say, a "home page" could contain subsections (subpages) like "contact-us" "request a quote", etc., whatever the client needs. So, if the client needs a new page, say, "about", he does it. If he needs section for that page, he will make a sub-page of "about". The "about" page then, should load the contents of the page and its subpages in the sidebar (disregarding how many sub-pages he could have, the sidebar for each page should show all sub-pages for that specific page).

    Here's a mockup of the site layout: http://img364.imageshack.us/img364/611/37341435oo8.gif

    Since I'm a designer I found this a bit tricky to do. I can do the 1, 2 and 3, but don't know how to reuse the $wp_query object (that should be stored in a temp variable while doing the loop for the page I think) to show the content for each sub-page. I know I could do this knowing the page number in each template file and doing a query_post(), but the idea is to let client add/delete pages on the fly while in the WP admin.

    Any ideas? I love WordPress and I'm starting to using it as a CMS ... but this exceeds me :D

    Thanks!

    Rodrigo

  2. ryanarrowsmith
    Member
    Posted 6 years ago #

    First off, I'd create a home.php and drop it in your directory. This will give you a specialized homepage without disrupting the rest of the site. Then, I'd use custom queries instead of the traditional loop for each sections...something like this:

    <?php $my_query = new WP_Query('cat=1');
    while ($my_query->have_posts()) : $my_query->the_post();?>

    // Your Loop Here

    <?php endwhile; ?>

  3. rodrigogalindez
    Member
    Posted 6 years ago #

    Hey Ryan,

    Thanks. I'm using a custom template page as you suggesting, and so far it works nice.

    Lastly I used custom fields and a hack for get_custom fields so it displays all the custom fields but not the _wp_page_template.

    It works by now.

    Thanks!

  4. rubymoon
    Member
    Posted 6 years ago #

    Okay, so I have done a fair amount of configuring and customizing/editing templates and yet this thread just goes right over my head. I have read the general documentation and would like to understand or find a complete tutorial on what you described above as the fix.

    Are there tutorials that exist on this topic of subpage, query within specialized home page customization??

Topic Closed

This topic has been closed to new replies.

About this Topic