WordPress.org

Ready to get started?Download WordPress

Forums

Add as second blog as a page (19 posts)

  1. frankandeffie
    Member
    Posted 5 years ago #

    Hi there, I may be posting in the wrong area, but I'm just not sure where to go. I took a look in the forum already and found some similar posts to my own but nothing that really helps me so I was hoping there is someone out there that could show me what to do.

    So I just started my website and installed WordPress. On my main page I have a blog (obviously) and I would like a second blog that is just one of my pages but I'm not sure how to do that. I still want to keep the same theme and what not, I just want another blog. I have taken a look at the plugs ins available and have even tried a few but I can't seem to get them to work the way I would like.

    I'm probably just a little slow at this whole thing considering designing websites has really changes since I was in high school. So if anyone has any ideas or tips please let me know! I would love some help.

    Thanks.

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    Why another blog? Why not use categories to sub-divide your posts and, if necessary, only list posts from Category A on your front page and posts from Category B on your underlying page.

  3. frankandeffie
    Member
    Posted 5 years ago #

    Alright I didn't know that was possible either. So how would I go about doing that?

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    Which bit? Posting within different categories or listing posts from only one category?

  5. frankandeffie
    Member
    Posted 5 years ago #

    "only list posts from Category A on your front page and posts from Category B on your underlying page"

    I think that would be the easier for me to understand.

  6. esmi
    Forum Moderator
    Posted 5 years ago #

    First, check to see if your theme has a category.php file. If it doesn't, make a copy of index.php and name this new file category.php.

    Then edit index.php and just before the Loop begins with <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    Add:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'Name_Of_Category_A',
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    That should limit the display on the front page to just those posts in Category A.

    Next create a new page template based on page.php:

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    At the top of this new template file, just before <?php get_header(); ?>, add the line <?php global $more;?>. Again, just before the Loop begins, add the block:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'Name_Of_Category_B',
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    Again, this limits the display to just Category B. Almost done...

    Change the reference to <?php the_content(); ?> to <?php $more = 0;the_content(); ?>. Along with global $more; at the top of the file, this ensures that the <-- more --> tag works within a static page.

    Finally, immediately after <?php endwhile; ?>, add <?php posts_nav_link();?> to provide you with some previous/next navigation.

    Once your new page template is complete, use Admin/Pages/Add New to create a new page. Give the page a title (whatever you want to call this second blog) and leave the post area blank but be sure to assign the new template to it via the Template dropdown in the Attributes tab before publishing it.

    Phew! Done! :-)

  7. katrin-hh
    Member
    Posted 5 years ago #

    Also ich denke Luxes UG ist die beste was ne Wohnungssuchende passieren kann.Ich habe davor echt lange gesucht und sobald ich bei Luxes war habe ich ne Wohnung in Hamburg gefunden.Leute die sind echt gut. Katrin-hh

  8. frankandeffie
    Member
    Posted 5 years ago #

    Awesome! Thanks, I will give that a try tonight and see if I can make some magic happen.

    Thanks again!

  9. frankandeffie
    Member
    Posted 5 years ago #

    Ok, so the instructions were great. i haven't tested it out yet to see if I did everything right because I am a little confused by the last part.

    "be sure to assign the new template to it via the Template dropdown in the Attributes tab before publishing it"

    I'm at the Attributes tab on that page but I'm not sure where the Template dropdown is.

    Thanks!

  10. frankandeffie
    Member
    Posted 5 years ago #

    Alright, never mind about the template drop down. I think I've got that all figured out, but I'm having problems with the posting. I followed the directions to a T, I hope, and I can create posts and I put them in the A category or the B category each post seems to be off floating on its own. The posts in the A category should be on the main, index page, but aren't and same with cat B. Is there something that I'm missing?

    And thanks again for all of your help.

  11. esmi
    Forum Moderator
    Posted 5 years ago #

    Can you post a link to your site so I can see if I can figure out what's gone wrong?

  12. seaneee
    Member
    Posted 5 years ago #

    This was a great solve, was just thinking about how to do this. Dumb question though. What if I still want content that explains the page before it starts listing the posts. When I added this code, it got rid of the initial description I had on the page.

  13. esmi
    Forum Moderator
    Posted 5 years ago #

    @seaneee: I've not needed that yet but, off the top of my head, it might be worth looking at whether you can pull in the category description outside of the Loop.

  14. doncampbell
    Member
    Posted 5 years ago #

    @seaneee,
    If you want content that explains the page before it starts listing the posts, you'll have to add that content into the page template PHP file itself. When a page is based on a page template, it ignores all of the content that you put into the editor interface.

    Here is a video on setting up custom Page Template that might be helpful: Make WordPress Look Like a Website.

  15. mtantow
    Member
    Posted 5 years ago #

    How do I add a new theme file, like category.php. I can't find an "add new file" button. Thanks!

  16. seaneee
    Member
    Posted 5 years ago #

    So I figured it out for the most part, but now I'm running into two issues. First and foremost, the $more tag doesn't work even though I added the code into the page as esmi suggested.

    Page

    Code:

    <?php
    /*
    Template Name: kickstand
    */
    ?>
    <?php global $more;?>
    <?php get_header(); ?>
    <div id="intros">
    <p>Welcome to the Kickstand!</p>
    <p><br class="spacer_" /></p>
    <p>For some of you, it may come as a surprise that we have passions beyond cycling. I know, it stings a bit, but like other things too. Music, Art, Snow Angels, Pop Tarts and the occasional episode of "Cheaters". So we present the Kickstand, a section where you will soon find all the best "off topic" posts we can muster.</p>
    <p><br class="spacer_" /></p>
    <p>Why The Kickstand you ask? Well because it sorta' sounds like The News Stand which is very official and proper, but it's bike related- That and a kickstand is super useful and awesome (like the posts on this page will be) but you don't want it anywhere near your bike (like the posts on the main page). Get it?</p>
    <p><br class="spacer_" /></p>
    So here goes, enjoy:
    <p><br class="spacer_" /></p>
    P.S.- We're still working the bugs out, so please be patient.
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    <p><br class="spacer_" /></p>
    </div>
    <div id="posts">
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'kickstand',
    	'paged' => $paged
    );
    query_posts($args);
    ?>
      <?php if (have_posts()) : ?>
      <?php while (have_posts()) : the_post(); if (in_category('143') && is_home() ) continue;?>
      <div class="post" id="post-<?php the_ID(); ?>">
        <!--<div class="pinfo">-->
    <div id="xsnazzy">
      <b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>
            <div class="xboxcontent">
    <ul class="pinfo">
                <li class="lileft"><span>
                  <?php the_time('j') ?>
                  <br />
                  <em>
                  <?php the_time('M') ?>
                  </em></span>
                </li>
                <li class="liright">
                  <div><div><h1><a title='Permanent Link to <?php the_title(); ?>' href='<?php
                  the_permalink() ?>' rel='bookmark'><?php the_title(); ?></a></h1></div></div>
                </li>
    </ul>
    </div>  
    
    <b class="xbottom"><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1">
          </b></b>
          </div> 
    
        <!--</div>-->
        <div class="postcontent">
    <?php $more = 0; the_content('<span>Read the rest of this entry...</span>');?>
          <span class="postcom"><?php comments_popup_link('contribute', 'one comment', '% comments'); ?></span>
        </div>
      </div>
      <?php endwhile; ?>
      <div id="navigation">
        <?php posts_nav_link('','<span class="prev">Newer Entries &raquo;</span>','') ?>
        <?php posts_nav_link('','','<span class="next">&laquo; Older Entries</span>') ?>
      </div>
      <?php else : ?>
      <div class="post">
        <div id="xsnazzy">
      <b class="xtop"><b class="xb1"></b><b class="xb2"></b><b class="xb3"></b><b class="xb4"></b></b>
            <div class="xboxcontent">
    <ul class="pinfo">
                <li class="lileft"><span>
                  <?php the_time('j') ?>
                  <br />
                  <em>
                  <?php the_time('M') ?>
                  </em></span>
                </li>
                <li class="liright">
                  <div><div><h1><a title='Permanent Link to <?php the_title(); ?>' href='<?php
                  the_permalink() ?>' rel='bookmark'><?php the_title(); ?></a></h1></div></div>
                </li>
    </ul>
    </div>
    <b class="xbottom"><b class="xb4"></b><b class="xb3"></b><b class="xb2"></b><b class="xb1">
          </b></b>
          </div>
        <div class="postcontent">
        <?php _e('Sorry, no posts matched your criteria.'); ?>
        </div>
      </div>
      <?php endif; ?>
    <div id="comments">
        <?php comments_template(); ?>
      </div>
    </div>
    <!--<?php get_sidebar(); ?>-->
    <?php include('rsidebar.php'); ?>
    <?php get_footer(); ?>

    The last issue isn't as big of a deal. It's just that the intro text is pushing the sidebar down. I'm guessing I need to add some parameters to the CSS I'm calling. Note that right now I have the text wide so it doesn't look weird, but when I align it with the posts, it still pushes the sidebar down.

    Any suggestions would be great. You have all been extremely helpful thus far.

  17. seaneee
    Member
    Posted 5 years ago #

    So I'm close to getting the CSS dealy worked out. I'm having a spot with the width/alignment though. Still not the main issue.

    Would really like to find a solve for "more" and I notice that the "previous" and "next" functionality is also dead.

  18. kahoonas
    Member
    Posted 5 years ago #

    Esmi, that's superb. That is exactly what I needed. Thanks very much.

  19. curious6webdesign
    Member
    Posted 4 years ago #

    Hi esmi.

    I too wanted the effect of two blogs, so have done the same as you suggested in your third post. Well actually I just added this bit as it seemed to work...

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    'category_name' => 'Consumer',
    'paged' => $paged
    );
    query_posts($args);
    ?>

    The only problem I have, is that the photos within the blog don't show?

    This is the front page looking great:
    http://curious6webdesign.com/wordpress/

    And this is my "second blog", with the above text filtering so only 'Consumer' catagory posts show, you can see that the images don't show?
    http://curious6webdesign.com/wordpress/?page_id=60

    ...any ideas?

    I am running WordPress 2.6 with Atahualpa theme.

    Thanks!
    Rich.

Topic Closed

This topic has been closed to new replies.

About this Topic