• I am building this website for a friend’s small business. Encore Fence

    They want to change the front page so that it has thumbnails and brief excerpt of the child pages, like this other fence company has on their page. Ace Fence

    Encore Fence has the index as a static page. There is no blog page. The main page has child pages for each different kind of fencing or service offered. I need to pull an excerpt (manual or automatic doesn’t matter) along with the featured image as a thumbnail. I also need them arranged like the Ace Fence website.

    I am comfortable making changes to the php files and css but I can’t seem to get my head wrapped around this issue. I have been studying the loop but it’s just not making sense to me. I want to learn how to write themes from scratch and I want to learn about the loop but I’m in a brain fog and its just not clicking.

    Can someone help me out please?!?!?
    Thanks!
    Victoria

Viewing 1 replies (of 1 total)
  • Hi Victoria – It’s certainly up to you if you want to write themes from scratch or not, but if there’s something out there that does close to what you want, you may want to start with that first, as it can often make life easier. Then again, maybe I’m just lazy. 🙂

    As to The Loop, you say you’ve been reading – have you been reading up on the function page? You don’t really have to do so, just trying to get an idea of where you are and what you are comfortable with doing.

    The simplest way to think about it is to just think of The Loop as looping (see what I did there?) through all of your posts. each iteration of The Loop is just one loop through that post. When you are inside The Loop, you are working with one post, and from the while (start) to the endwhile (end), you process that post, and only that one post, so you’re pulling out information on that one post. Everything in between is shown for the post that is current at that time.

    Make sense?

    So what you then need to decide is what you’re going to display about that post. Say you want to display a picture of a particular fence style – you may want to use:

    <?php
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
      the_post_thumbnail();
    }
    ?>

    To show the featured image/post thumbnail for that post. (You’re first checking to see if there is one, and if so, displaying it.) Of course, you can do other things like adding a title, displaying a link, etc – but this will hopefully give you an idea of what you can do.

    Once you pull out the data, you will of course need to format it, but that’s another issue entirely. Just make sure you are inside of that while statement (The Loop) and you’re all good.

Viewing 1 replies (of 1 total)
  • The topic ‘Twenty twelve show child page excerpt-not bog posts’ is closed to new replies.