Tweaking WordPress Web Pages to Look Like Websites Rather than Blogs - dummies

Tweaking WordPress Web Pages to Look Like Websites Rather than Blogs

By Lisa Sabin-Wilson

Using a static page as a front page allows you to get creative with the design and layout of your page in WordPress. You can assign a page template and/or use widgets to include different types of content and information, such as

  • Featured Images: You can create a page template that includes the titles and excerpts of your most recent blog posts (if you’re using a blog) and display them in the body or sidebar with a featured image thumbnail. You use the WP_Query() class tag shown in the following code sample, which displays the four most recent posts from your blog:

    <?php $the_query = new WP_Query(‘posts_per_page=4’); ?>
    <?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
    <strong><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to
    <?php the_title_attribute(); ?>"><?php the_title(); ?></a></strong>
    <?php if ( has_post_thumbnail() ) { the_post_thumbnail('thumbnail'); ?>
    <?php the_excerpt(); ?>
    <?php endwhile; ?>
  • Featured Content Slider: Using a plugin for WordPress called the Featured Content Slider, you can include a slide show of your most recent posts that contains featured images, excerpts of text, and the front page title, which is a nice way to invite readers into your site to read blog posts. The Featured Content Slider provides you with an options page and widget to use on your front page.

  • Testimonials: Many businesses like to include client testimonials on their websites, and one of the best places to display them is on your front page so that your visitors can immediately see quotes from your happy clients.

    You can display testimonials with a plugin for WordPress called IvyCat AJAX Testimonials; after you’ve installed this plugin, you can create testimonials and include them on your front page using a widget that the plugin provides. The plugin also allows you to create a full testimonials page to display all testimonials — be sure to read the plugin documentation to find out how.

  • Portfolio: In the design field, you will most likely want to show off some of the work you’ve recently done for web design projects for yourself or your clients. You can accomplish this through the use of WordPress custom post types, categories, featured images, and the WP_Query() template class.

    Create a category on your WordPress Dashboard (choose Posts→Categories) called Portfolio (or whatever you wish to call your body of work) and then create posts within the category, and be sure to assign featured images to the posts.

    You can add a specific size for your images in the Theme Functions template called portfolio, and then using the WP_Query() template class, and insert these lines of code in your home page template to display just the images (linked to the individual posts) in the portfolio:

<?php $the_query = new WP_Query(‘posts_per_page=3&category_name=portfolio); ?>
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to
<?php the_title_attribute();?>”>
<?php if ( has_post_thumbnail() ) { the_post_thumbnail('portfolio'); ?>
<?php endwhile; ?>