WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] A page link to category in K2 Theme (3 posts)

  1. Starkmann
    Member
    Posted 7 years ago #

    Ok, I know this is out there but I have searched and tried quite a few things and am clearly missing the boat. So I apologize for asking a question for which the answer is out there but I'm getting really frustrated.

    I am helping a friend with his WordPress blog. http://www.bemoretraining.com/blog/

    He has requested that he be able to basically run two blogs, separate but equal off of it. The first blog is the the one that is on the home page I linked to above. I was able to get him to agree to limit his posts to the category of News so I simply queried off of that. It does what I want it to do.
    He wants the second blog to exist behind the link at the top of the page that says training. Once again he has agreed to limit his posts to a category called Workout. So all I really need to be able to do is have that link click over to the main index but with a different query filter on it.
    I thought maybe I could just find the url for the archive of that catalog and insert it in the code but I can't find the right piece of code. If someone could point out where on a K2 theme I can do that, it would probably solve my issue.
    The second thought I had was to try and actually insert a version of the Main Index behind that link that would again filter for the second category. To do so I downloaded the CG-QuickPHP plugin from Chaitgear. My understanding is that if I just past in PHP code this plugin allows it to run for me, even if posted from a page or post link. I tried that only ever got scraps of code appearing on the page.

    If someone sees what I am missing or some approach that I have not yet considered, please fill me in. I'm about to be pulling my hair out here.

    thanks for very much for your help and for letting me vent it a bit.

  2. moshu
    Member
    Posted 7 years ago #

    You seem to over-complicate it.
    For excluding a category from the main page:
    http://ryowebsite.com/?p=46
    And for the "second blog" - which is actually a category - you have it already working: just using the "normal" catgeory links (example.com/?cat=XX) takes you to a 'page' where only posts from that category are displayed - you don't need any trick for that. WP is smarter than you think :)

    Now, how that second thing loooks like... that's an entirely different question and it's up to you define it:
    http://codex.wordpress.org/Category_Templates

  3. Starkmann
    Member
    Posted 7 years ago #

    My bad.
    I didn't explain myself well at all.

    So as you said he wants two different blogs which are really categories.

    So for the main page I popped this into the main index.
    <?php
    if (is_home()) {
    query_posts("cat=1");
    }
    ?>
    and it limits the main page to one category. sweet

    I was thinking I would try to link directly to the category archive (http://www.bemoretraining.com/blog/?cat=2) for getting to the second category (which is pretty much what you recommended above). Unfortunately I couldn't find where this theme was getting the page links from, so I couldn't hard code it. I since found that. So I have linked it in.

    So my two primary goals of limiting the front page and making a link to the second category(as blog).

    I did an ounce of clean up, like dumping the bit that says "Archive of Training category". One item remains. The script that runs the tabs at the top, to make the white when active, blue when not and black when hovered is broken. I think I know why, I just have to fix it. In the mean time I will mark this as resolved. If I can't crack that nut in a couple days I'll pop that question in here.

    The second half of the above post was simply another thought on how I could solve the problem in a different way if I was way off target. It was ugly and incomprehensible.

    I appreciate the help Moshu. I'll be back for more, as always :-)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags