• Hello.

    I am running WP 1.5.1.2. (Note: I love the easy installs! I made my own theme, so upgrading is a snap! No worry or time consuming editting of index.php [etc.] to get the look I have!)

    My blog runs on https://me.mysite.com/, and the main site is https://www.mysite.com/. One of the categories of me.mysite is “Front Page”.

    I would like to be able to get the latest post from the category “Front Page” and show it on https://www.mysite.com/, the non-blog part. New posts to “Front Page” would consequently cheat the page @ mysite.com.

    This would save me a lot of time and effort to keep fresh content on my main page with less effort. (Right now I’m manually putting content into the HTML and uploading the new index to the site, then posting the same thing again on my blog’s “Front Page”.)

    If there was a way to create a link below the Front Page content on the main site to comment on it in my blog, that’d be swell too.

    If this doesn’t make sense, please tell me and I will attempt to clarify.

    Thank You,
    John

Viewing 10 replies - 1 through 10 (of 10 total)
  • Well it makes perfect sense, and its a good idea. It may be a bit tough.

    Lacking any better ideas, I’d suggest you hook into your wordpress rss feeds. Using a PHP feed reader like Magpie RSS you would display some entries on your home (www.mysite.com). You would use your default wordpress rss feeds, with a special parameter for displaying only from one category. Such as:

    https://www.me.mysite.com/wp-rss.php?cat=3

    Where ‘3’ equals the ID of the category “Front Page” (if you don’t know the id, check it in your manage categories part of the WP admin panel.

    This is just an idea to get you started, so if anyone has better ideas, you should present them!

    Check out using The_Loop, and maybe the plugin CG-Feedread.

    Thread Starter freeze

    (@freeze)

    Problem with RSS feeds is that I have links, pictures, etc. in these posts. RSS only gets the text.

    If I use the loop, I’d still have to figure out how to get the [email protected] to communicate with the stuff @me.mysite.com. I just don’t know how to do that. ??

    Put at the top of your index.php file (from the mysite.com) the call for the wp-blog-header
    <?php require('_path_to_/wp-blog-header.php'); ?>
    where _path_to_ is the path to that file, and after that you can use all the WP functions on your index page; e.g. the loop, customized queries etc.

    Thread Starter freeze

    (@freeze)

    Thank you, moshu.

    I seem to be so close to getting this to work, but I can’t get “the_content” to show.

    <?php
    $posts = get_posts(‘numberposts=1&offset=1&category=15’);
    foreach ($posts as $post) :
    ?>
    <h1><?php the_title() ?></h1>

    <?php the_content(‘Read on…’); ?>

    #respond”>Post a Comment

    <?php
    endforeach;
    ?>

    It’s weird how “the_excerpt” does work, but that removes links and images… which I need.

    I’ve tried other variations, but I can’t get what I want exactly. Any help with this last leg would be greatly appreciated.

    EDIT: Nevermind…..I guess I tend to overcomplicate things. ??
    ////////////
    The problem is, they are hosted on serparate domains (‘me’ is a subdomain), so including won’t work.

    Here’s another idea. Put another install in a folder in the main domain, say https://www.mysite.com/wordpress, then use this technique to get wordpress into the main directory.

    Next, copy the wp-config so that both wordpress installs are accessing the same database. And finally, write a small template (with The Loop) in your main page, that posts only messages in the ‘Front Page’ category. I could probably help with that part..
    /////

    Try a loop like this loop:

    <?php query_posts('category_name=special_cat&showposts=10'); ?>

    <?php while (have_posts()) : the_post(); ?>
    // Do special_cat stuff.
    <?php endwhile;?>

    @jalenack, I think you are still over-complicating it with two installs…

    @freeze,
    the_excerpt’s default behaviour is to strip the html markup. You can try using a plugin (like excerpt reloaded) to customize your excerpts;
    or you can use the <!–more–> tag in your posts.
    Another thing: you are using the pre-1.5 Loop in the example you gave above. (Why do you need offset?)
    What is exactly “the last leg” you need?

    Thread Starter freeze

    (@freeze)

    The two installs doesn’t work as the server URLs are stored in the database. This makes it so there can only be one install working with one database when in two seperate domains.

    However, I may be doing something wrong, but I’ve been tinkering with this for an hour or two now.

    Thread Starter freeze

    (@freeze)

    Hmm, now I can’t get the_excerpt to work.

    I guess by ‘last leg’, I meant the actual code.

    But none of it has worked so far, so I’m back to square one.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Content from blog entry going to front page?’ is closed to new replies.