Forums

[resolved] Custom loops and .htaccess - HELP!!! (4 posts)

  1. waydomatic
    Member
    Posted 5 years ago #

    Hi all,

    I'm building a rather complicated (for me) blog and need some advice.

    On the homepage, I want the loop to display a single category only. Easy enough - but here's the catch...

    I want the "blog" running on a separate url eg. http://blah.com/blog/. This "blog" url should display the standard loop (posts and comments etc).

    At the moment I have wordpress installed into the root of my site. I'm thinking I'll need a .htaccess file to accomplish what I need.

    Does anyone have any experience setting up a site like this? How do I go about it? Can I add custom loops to wordpress pages?

    Help!

  2. jadmadi
    Member
    Posted 5 years ago #

    I do such thing with custom queries
    <?php
    $Query = mysql_fetch_assoc(mysql_query("SELECT post_id FROM wp_post2cat WHERE category_id !='3' AND category_id !='2' ORDER BY rel_id DESC LIMIT 1"));
    $Last_Blog_Post = mysql_fetch_object(mysql_query("SELECT post_title, post_content, post_date, guid FROM wp_posts WHERE ID='$Query[post_id]' AND post_status ='publish'"));
    ?>
    <div id="last_news_item"><h3><?=$Last_Blog_Post->post_title?></h3>
    <p>
    <small><?=$Last_Blog_Post->post_date?></small>
    <a href="<?=$Last_Blog_Post->guid?>">
    <?=substr($Last_Blog_Post->post_content,'0','150');?>
    </a></p>
    </div>

  3. waydomatic
    Member
    Posted 5 years ago #

    Thanks jadmadi - but where whould this custom query go?

    In a wordpress page named blog?

  4. waydomatic
    Member
    Posted 5 years ago #

    Sweet! I just stumbled upon the solution here:

    http://codex.wordpress.org/Pages#Making_your_blog_appear_in_a_non-root_folder

    Me=happy!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags