Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mciarlo

    (@mciarlo)

    We were running 2.7.1 before the upgrade. We are not using anything like the code you describe in our template.

    I will take a look at your directions and implement as many as I can.

    Would a re-install of WordPress and recreation of the DB be recommended?

    Thread Starter mciarlo

    (@mciarlo)

    So, it appears I would have to edit the wp-config file to select the correct database, if each project were on a unique subdomain.

    The code looks something like:


    $host = $_SERVER['HTTP_HOST'];
    $parts = explode('.',$host);
    if ($parts[3] = "") {
    $domain = $parts[0];
    } else {
    $domain = $parts[1];
    }

    switch ($domain) {
    case "domain1":
    $db = "database1";
    break;
    case "domain2":
    $db = "database2";
    break;
    }

    define('DB_NAME', $db);
    define('DB_USER', 'user');
    define('DB_PASSWORD', 'password');
    define('DB_HOST', 'hostname');

    Taken from here.

    Got this to work:

    <?php
    global $more;
    // set $more to 0 in order to only get the first part of the post

    $lastposts = get_posts(‘numberposts=1’);
    foreach($lastposts as $post) :
    setup_postdata($post);
    $more = 0;
    ?>
    <h3>< a href=”<?php the_permalink(); ?>” id=”post-<?php the_ID(); ?>”><?php the_title(); ?></h3>
    <?php the_content(__(‘Read more’));?>
    <?php endforeach; ?>

Viewing 3 replies - 1 through 3 (of 3 total)