how to add a blog to a specific section on a wordpress website

Discussion in 'WordPress' started by leilal, Nov 2, 2010.

  1. #1
    Hi,

    I am trying to add a blog to a wordpress site, I know wordpress is for blogging but I have used it to make a website. I now want to add a blog to a section of the site and have a blog page too.

    could someone please help me

    Thank you
     
    leilal, Nov 2, 2010 IP
  2. sahmothers.com

    sahmothers.com Well-Known Member

    Messages:
    2,389
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    135
    #2
    I can help out if you need someone still. PM me if you still need it.

    It would be a very simple task as long as you want just a blog on say a certain page of your site domain.com/blog
     
    sahmothers.com, Nov 2, 2010 IP
  3. kiddo

    kiddo Peon

    Messages:
    243
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    sidebar plugin
     
    kiddo, Nov 2, 2010 IP
  4. leilal

    leilal Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hello,

    thank you for your reply's. The domail is www.strive-design.co.uk, on the first page we want the right side to have a blog. I have just put in some fake content to show what it would look like. We would like a blog page, but also say the first 3 blog posts to show on the front page where it says blog too. Do you know how to do this?

    Thank you

    Leila
     
    leilal, Nov 2, 2010 IP
  5. ishtar

    ishtar Well-Known Member

    Messages:
    297
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Hi Leilal,

    Create a copy of your page.php, call it page-blog.php.

    In the top add:
    
    <?php
    /*
    Template Name: blog
    */
    ?>
    
    Code (markup):

    In the area where the content should come, add:

    
         <?php
     $lastposts = get_posts('numberposts=2');
     foreach($lastposts as $post) :
        setup_postdata($post);
     ?>
     <h2><a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>"><?php the_title(); ?></a></h2>
    <small><?php the_time('l, j F Y') ?> <!-- by <?php the_author() ?> --></small>
    
    <?php the_excerpt(); ?>
    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="more-link">More <?php the_title(); ?></a>
     
    				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('Comments &#187;', '1 comment &#187;', '% comments &#187;'); ?></p>
                    
    
     <?php endforeach; ?>
    
    Code (markup):
    Create a page called blog, select the template to be blog, and you're done.

    If you're still stuck, just send me a PM.
     
    ishtar, Nov 2, 2010 IP
  6. leilal

    leilal Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hello,

    Thank you for your help.

    So do I put this code in the div I want the posts to show up in? I want to make a blog category then only the posts from this category show in the div, how do I put the category info in this code so it only shows posts from this category please?

    Thank you
     
    leilal, Nov 3, 2010 IP