• Resolved waydomatic

    (@waydomatic)


    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. https://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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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>

    Thread Starter waydomatic

    (@waydomatic)

    Thanks jadmadi – but where whould this custom query go?

    In a wordpress page named blog?

    Thread Starter waydomatic

    (@waydomatic)

    Sweet! I just stumbled upon the solution here:

    https://codex.www.ads-software.com/Pages#Making_your_blog_appear_in_a_non-root_folder

    Me=happy!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom loops and .htaccess – HELP!!!’ is closed to new replies.