how to create a miniblog on a page with in my main blog (22 posts)

  1. dtclarinet
    Posted 9 years ago #

    I've looked around for hours at the support and codex docs. I have played around with code and am confident about editing a bit, but I have not found any direct solution to aid me in reaching my goal. I've looked at the "post template by category" and "static front page" plugins, and I simply don't understand how they work. Sorry.

    I wish to create a separate mini-blog which which show all posts to a certain category only on the Page by that name.

    As I "dream" it, the Page title would show in my blog header. When a reader clicks on it, the mini-blog of that category would show, with new posts updated as I post to that category.

    Thanks to anyone who is willing to give me clear instructions on how to accomplish this. As I said, I do not understand how the above plugins will help me, YET.


  2. kuttu
    Posted 9 years ago #

    how to displa sub catagories on the main page

    shoul i have to edit html

  3. Ovidiu
    Posted 9 years ago #

    I am not sure if this is what you are looking for but have a look at this plugin: http://katesgasis.com/2005/10/24/sideblog/

  4. Starkmann
    Posted 9 years ago #

    If I'm reading right, you want to display all categories but one on your main page and then show the exclusion on a different page, maybe like an admin blog or something?

    am I close?

  5. EthanNeuen
    Posted 9 years ago #

    If you are going for what Starkmann said I might be able to help you in some way. In your main file index.php or what ever Find where you want you little side blog to display and enter this code
    <?php if (in_category('2')) continue; ?>

    The you are going to need to make a category what then find its id # and put it where the 2 is 'delete the 2' Then what ever you want to display in your sideblog you will have to put in the category that you have just made.
    Hope this helps.

  6. dtclarinet
    Posted 9 years ago #

    That's the idea of what I want, but I'm afraid those instructions are not helpful. I think I need to create a unique "page.php" file for the new mini-blog.

    I assume the loop needs to be in there somewhere, or does it?

    If anyone has done this successfully, please let me know.


  7. Starkmann
    Posted 9 years ago #

    Do you want both your main blog and your mini blog showing up on your main page or do you want one to be clicked to through a tab, as in http://www.superblogger.com is the general news site and then you click on a link or tab that says admin blog to access your miniblog?
    The instructions above cover the latter the former, is a bit more tricky. It's probably totally seperate installations and tables.

  8. dtclarinet
    Posted 9 years ago #

    http://www.superblogger.com is not a blog at all. It's a shopping site. I don't know what it is supposed to show me.

    I want to acces the miniblog by clicking through a tab in my menu bar.

    But I know it doesn't require a separate install.


  9. Chris_K
    Posted 9 years ago #

    I'm probably missing something obvious (my track record so far today), but let me just float this out there as your virtual pinata.

    Create "mini blog" posts in their own dedicated category.

    Use this plugin to prevent them from showing on the main page: http://ryowebsite.com/wp-plugins/category-visibility/

    Put a link to the the category page in your menu bar.
    For instance, if you using Permalinks, the link would be http://www.yourdomain.com/blog/category/YourMiniblogCatName

    Want that page to look a bit different? Have a look at Category_Templates.


  10. dtclarinet
    Posted 9 years ago #

    Sounds helpful. But how do I "Create "mini blog" posts in their own dedicated category"?

    Thinking out loud- I write a post to a certain category, say "miniblog". That category needs its own loop and index, right?

    OR, can I edit the main index.php file and redirect all posts in a certain category to be posted on a newly created page?


    I am using K2 theme, with its own peculiar structure. The index.php has no header call.

  11. dtclarinet
    Posted 9 years ago #

    I created a page using the default template, linked it using a "links_to" key to the "miniblog" category as suggested by HandySolo, and used the category visibility plugin to hide the mini cat posts from the front page.

    Now the posts show in their own page, but with no style, none.

    This is where I'm stuck.

    My blog it

    You can check the page called "Domesticity" in the header menu. The two posts I put are Cooking and Eating. Both show, but no template is called up.

  12. Chris_K
    Posted 9 years ago #

    Odds are, your K2 theme probably currently lists categories in the side bar (if it doesn't, have a look at a blog running the Default theme). Click a category in that list and the resulting page is just posts in that cat.

    As a rule of thumb, WP will handle the display of posts in that category for you. Either by using index.php or Category_Templates. Magic!

    I *think* the plugin I listed will work with K2 variants, but since I've never messed with K2, you might want to experiment a bit (or maybe K2 does that already)? The whole idea is just to ensure that posts with the "miniblog" category don't show up on the main page.

  13. dtclarinet
    Posted 9 years ago #

    I managed to get things to work a bit better. I created a VERY crude category page template with lots of cut and paste, which at least syled the page to show the posts. When I opened each post, it was just too messy in layout, though it had my theme style, at least.

    So, I decided to delete the whole project for now.

    I couldn't get the posts to that category NOT to show in the recent posts listing, even though they weren't visible anywhere else.

    Close, but no cigar.

  14. Starkmann
    Posted 9 years ago #

    sorry, not trying to throw you off with the super blogger link, I meant that to be an made up name, didn't think about it linking to something.

    As for creating a category of mini blog, it's easy.

    Ethan and handy have given you everything.
    I made one for this guy: http://www.bemoretraining.com/blog
    and yeas that one is meant to be a real link

    EDIT: realized I said it was easy but it was huge pain to me at the time, but that is the way of things. You'll get it, these guys have taken good care of you.

  15. dtclarinet
    Posted 9 years ago #

    Starkmann- The blog you linked to is exactly what I want. I think the way I had it set up was about what you and ethan and handy were suggesting. I'll mess with it when I have lots of time.

    Question for EthanNeuen-
    When you suggest I add the php call to a category to my "main file index.php or what ever ..." which file do you suggest? In K2 there is a loop.php will calls the post from the database. There is no such loop in the index.php.

    thanks for the helpful and patient suggestions.


  16. Lorelle
    Posted 9 years ago #

    If I understand what you want to do correctly, here is a simple, off-the-top of the head solution.

    1. Using whatever method you found above to "eliminate" a category from your category list, wherever your category list is shown, if you don't want that category shown in that list.

    2. Create a manual link to your chosen category (let's call it Alpha with an ID number of 5) in your WordPress Theme header template file where you want the link to the category to appear.

    <a href="/index.php?cat=5">Alpha</a>

    3. Using the Template Hierarchy, create a Category Template called category-5.php and put it in your WordPress Theme folder.

    Make it "look" however you want it to look by copying the code and design elements from your index.php or category.php. Be sure to include the "includes" for the header, sidebar, footer, etc. You may want to change the_content() to the_excerpt() to show only excerpts not full posts. You can include custom text or whatever you want on that template file.

    4. When a user clicks on the Alpha link, it will automatically call up the category with ID number five and show only the posts within that category. There is nothing you have to do to the WordPress Loop or anything.

    If category 5 shows up in any category list, like in a category list on a post, any time anyone clicks the Alpha category, WordPress will automatically display that custom category page.

    There is nothing more "special" you have to do.

    Part of the confusion on this was your use of "page". In WordPress, a "Page" is a special type of web page and a "page" is another word for "web page", which is any web page on your blog. A "post" is a web page with your post content, and that uses the WordPress Loop to be generated on your WordPress blog web pages.

    Putting a self-generating list of posts from a specific category on a Page makes things complicated. However, customizing a category page is easy, no messing with the Loop.


    If you would like a list of the posts ONLY in the Alpha category to be seen in a special section on the front page of your blog, that's a different issue. There are a lot of ways you can do this. If you want it to appear on every page, see query_posts or check out Customizable Post Listings WordPress Plugin by Scott Reilly to show the posts from a specific category, from inside or outside the WordPress Loop.

    If you want the list of Alpha's post to appear ONLY on the front page and not on the other web pages on your blog, then you can use a conditional tag statement in your sidebar, header, or wherever, that lists the last 5 posts in that category:

    if (is_home()) { ; ?>
    <h5><a href="/index.php?cat=5">Alpha</a></h5>
    $myposts = get_posts('numberposts=5&category=5');
    foreach($myposts as $post) :
    <li><a href="<?php the_permalink(); ?>">
    <?php the_title(); ?></a></li>
    <?php endforeach; ?>
    <?php }; ?>

    I shouldn't write code this late at night, so someone please fix this if I messed up.

    There are a lot of ways you can do this, including with the Customizable Post Listing WordPress Plugin or using a feed link to that specific category in a Widget or manually generated so you wouldn't have to use all that code. Try one of the various Feed/Syndication WordPress Plugins to help you do this to make it easier.

    Hopefully this will help you do what you want. You can also set up a whole separate blog within a blog, but you are only messing with a specific category that you want "within" your current blog. This also allows you to change your mind when you are done highlighting that specific category, giving you more flexibility.

    Am I on the right track?

  17. Lorelle
    Posted 9 years ago #

    Oh, if you don't want custom content or design elements on your Alpha category that looks different from the rest of your category pages - you want it to basically look the same, just have the posts only from Alpha show up, then do most of nothing I just explained except to create a manual link wherever you want it to appear in your header.

    When clicked, WordPress will automatically use the category template file (or whatever is its equivalent) to showcase ONLY posts in the Alpha category. All you have to do is provide the link, highlighted in whatever manner you like.

    I have over 40 categories on my main site but on the header of every page, you only see the top 7, and I've manual links to specific categories all over my various sidebars, but the reader doesn't realize it.

    I also use custom category template files, as described above, on ALL 47+ categories, each one containing content and posts specific to each category. Poke around to see if this is more what you want to do.

  18. Lorelle
    Posted 9 years ago #

    See also Adding Asides as that is another similar technique.

  19. dtclarinet
    Posted 9 years ago #

    THanks, Lorelle. This is a very helpful tutorial. I will set it up when I have some time to make sure it's right.

  20. dtclarinet
    Posted 9 years ago #

    YAY- It worked- I had to add the sub (/blog) level where my blog files are to the link.

    It took me awhile to figure out where to put the manual link in my header template so it would show in the menu. I thought it had to be created on a Page, with a capital P.

    I also had to add separate style sheet classes for that link to get it to match the others in the menu.(even though the link was within the div for those very classes for the pages call. go figure)

    I did it without creating a category template, but I have also created one just copying the index.php file. Now I can edit it and style it a bit.

    OK, the index template works fine, but with more than one post, it calls it an Archive. I don't want that. Any suggestions?

    This is so exciting. I never thought it would be so easy. Thanks Lorelle and all you others...

  21. dtclarinet
    Posted 9 years ago #

    I'm getting a database error when I publish or edit to the mini-blog category, whose category is 72. (I use an asides sideblog as well) Does anyone know what might be causing this issue? I use a K2 theme.
    thanks, David

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND p2c.category_id <> 1 AND p2c.category_id <> 4 AND p2c.cat]
    SELECT DISTINCT MONTH(p.post_date) AS month FROM wp_posts p INNER JOIN wp_post2cat p2c ON (p.ID = p2c.post_id ) WHERE YEAR(p.post_date) = AND p2c.category_id <> 1 AND p2c.category_id <> 4 AND p2c.category_id <> 36 AND p2c.category_id <> 41 AND p2c.category_id <> 72 AND p2c.category_id <> 57 AND p.post_date_gmt < '2006-11-17 06:49:32' ORDER By p.post_date DESC

  22. Lorelle
    Posted 9 years ago #

    Are you using the Asides technique or the one I wrote manually above?

    Hopefully someone will have a better answer, but we need to know the specifics. Sorry for the delay in responding. I'm still traveling.

Topic Closed

This topic has been closed to new replies.

About this Topic