WordPress.org

Ready to get started?Download WordPress

Forums

Secondary blog or a sub-blog (15 posts)

  1. Soder
    Member
    Posted 4 years ago #

    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

  2. Nessdufrat
    Member
    Posted 4 years ago #

    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 ?

  3. Soder
    Member
    Posted 4 years ago #

    Actually that would work.

    Hm..

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

  4. Nessdufrat
    Member
    Posted 4 years ago #

    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 :)

  5. Nessdufrat
    Member
    Posted 4 years ago #

    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.

  6. Soder
    Member
    Posted 4 years ago #

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

  7. Nessdufrat
    Member
    Posted 4 years ago #

    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

  8. Soder
    Member
    Posted 4 years ago #

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

  9. Nessdufrat
    Member
    Posted 4 years ago #

    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.

  10. Soder
    Member
    Posted 4 years ago #

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

  11. Soder
    Member
    Posted 4 years ago #

    Nevermind, found it! Thanks!

  12. Soder
    Member
    Posted 4 years ago #

    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 :)

  13. Nessdufrat
    Member
    Posted 4 years ago #

    I'm glad it worked :)

  14. kalmaguer
    Member
    Posted 4 years ago #

    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!

  15. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.