WordPress.org

Ready to get started?Download WordPress

Forums

Custom Homepage using Featured Images of Pages? (2 posts)

  1. adamfratino
    Member
    Posted 1 year ago #

    I've been working with WordPress for awhile, but I've only recently started to develop my own themes. My first project is a simple portfolio site for myself.

    What I'm wondering is, how do I create a custom page template that will display the featured images (and possibly other data) of my pages? What I'm trying to accomplish is very similar to how Cargo Collective is laid out (ref: http://www.cargocollective.com/adamfratino). Another example can be found in the Sideshow theme by Orman Clark here: http://demo.themezilla.com/sideshow/

    I've browsed through the codex but it's all very new to me. I figured I'd ask here and hopefully someone would be able to point me in the right direction.

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    review
    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
    http://codex.wordpress.org/The_Loop
    http://codex.wordpress.org/Class_Reference/WP_Query
    http://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters
    i.e. 'post_type' => 'page'
    http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
    i.e. 'meta_key' => '_thumbnail_id'
    http://codex.wordpress.org/Post_Thumbnails

    basically create a page template, with a (secondary) loop and a query build with WP_Query; using the arguments 'post_type' => 'page' and 'meta_key' => '_thumbnail_id' to query only pages with featured images.

Topic Closed

This topic has been closed to new replies.

About this Topic