Support » Fixing WordPress » Secondary blog or a sub-blog

  • Soder

    (@soder)


    Hi!

    My New Years Resolution is to get more fit… (wow.. how original…) and I wanted to add a secondary trainingblog or a “sub-blog” if you will to my normal blogg. I want it to show among the pages on the top of the site.

    I want to work exactly as a blogg but embedded into my current wordpress blogg, ie I don’t want to create a new blogg.

    Hope I explained myself enough…

    Thanks!
    – John

Viewing 14 replies - 1 through 14 (of 14 total)
  • Nessdufrat

    (@nessdufrat)

    You could do it by displaying a specific category on this page, and using it as a “blog”.
    You’d have all the categories except this one on your main blog, and this new category displayed as a separate page.
    Would this solution be working for you ? Is that what you’re looking for ?

    Soder

    (@soder)

    Actually that would work.

    Hm..

    How would I accomplish that? The filtering part on the mainblog and the showing of only that category?

    Nessdufrat

    (@nessdufrat)

    I did it a while ago with dotclear (it’s similar to WP but developed by French people), it was not hard to do it, let me look through my files (it was 5 years ago ^^), I’ll get back to you 🙂

    Nessdufrat

    (@nessdufrat)

    Ok, so until I find my files, I looked a bit through the WP docs, and this article will be helpful :

    http://codex.wordpress.org/The_Loop (read the Exclude Posts From Some Category )

    As well as this :

    http://perishablepress.com/press/2007/08/06/super-loop-exclude-specific-categories-and-display-any-number-of-posts/

    You will have to use template pages to achieve that. You’ll need to use the “home” feature, as well as a template page for the new category you’ll be creating.

    http://codex.wordpress.org/Category_Templates

    http://codex.wordpress.org/Conditional_Tags

    With these articles, you can get a head start.

    Soder

    (@soder)

    Wow thanks for all the help and thanks for your time! This is very useful! I’ll tell you how it works out!

    Nessdufrat

    (@nessdufrat)

    Ok, so I found the solution to exclude your new category from your main blog, it’s really easy, you can check it here :
    http://wordpress.org/support/topic/168940?replies=2

    Soder

    (@soder)

    Yep that part was really easy, now I pretty much need to do the same thing but inverted 😉

    Nessdufrat

    (@nessdufrat)

    You create a page template based on your index file, and instead of the loop to exclude one category, you tell it to display one category. Sorry, I didn’t find what I was looking for, and if I give you dotclear code, it won’t work with wordpress.

    <?php query_posts('cat=ID&showposts='.get_option('posts_per_page')); ?>

    You need to replace ID by your new category ID number.

    Soder

    (@soder)

    Hm can I have more than one page template? Since I have “normal” pages and this special one?

    Soder

    (@soder)

    Nevermind, found it! Thanks!

    Soder

    (@soder)

    It works superb now!

    If anyone else are looking for a similar solution here’s what I did:

    Added

    <?php query_posts($query_string . '&cat=-ID'); ?>

    to index.html before the loop, (ID = the category ID)
    this prevents all posts with that category ID to show in the main blog.

    I created the page template with essentially the same code as the one in index.html but the above code changed to

    <?php query_posts("cat=ID"); ?>

    which shows all posts with that category id.

    pretty easy solution if I may say so 🙂

    Nessdufrat

    (@nessdufrat)

    I’m glad it worked 🙂

    Thank you both for this info. Is there an easy way to tie this concept in to a main menu (navigation) item? I would like users to be able to click on one of my main navigation links at the top of the site and be routed to a page that displays posts only related to that topic (category). Thanks!

    now that you are familiar with includes and excludes…

    you can mess with your navigation using wp_list_pages
    http://codex.wordpress.org/Template_Tags/wp_list_pages

    and wp_list_categories
    http://codex.wordpress.org/Template_Tags/wp_list_categories

    includes and excludes work there too

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Secondary blog or a sub-blog’ is closed to new replies.