• I have a couple of blogs – a personal one, a travel one, etc – and I was wondering whether it was possible to have them appear separately using ‘pages’? I’m very new to this whole process! Are pages only for ‘fixed’ content? Is there only one ‘blog’ that I can post to? I’ve imported my blogs from blogger so at the moment they’re all sitting in one big blog but yeah, was hoping to separate them if possible…
    Hope you can help!
    Thanks heaps

Viewing 1 replies (of 1 total)
  • to display one category on a page:
    edit the page.php template in a text editor – not a word processor
    /wp-content/themes/{themename}/page.php

    find the start of the WordPress loop
    ( looks something like this)

    <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>

    add this next code before those lines – add your additional categories, change the category ID codes to the ones on your installation. the text in is_page(‘xxx’) should be the page slug (URL) (or the page ID) from your static WordPress page

    <?php
    $cat = '';
    if (is_page('events') {
       $cat = '6';  // the WP category ID code for the events category
    } elseif (is_page('activities') {
       $cat = '11';  // the WP category ID code for the activities category
    }
    
    if ($cat) {
      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      query_posts("cat=$cat&amp;paged=$paged");
    } ?>
    
    [loop starts here]   === delete this line - next code is already in page.php
    
    <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>

    see http://codex.wordpress.org/Template_Tags/query_posts

Viewing 1 replies (of 1 total)
  • The topic ‘Can I link certain blogs to certain pages?’ is closed to new replies.