Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Forum: Fixing WordPress
    In reply to: Updating to 3.5

    I figured this out. It looks like it was this patch that is causing the conflict:

    http://core.trac.ww.wp.xz.cn/attachment/ticket/20533/20533.patch

    What fixed it correctly for me was to add the following line to wp-settings.php (just the line, not my “<<<< add this” annotation below):

    require( ABSPATH . WPINC . ‘/update.php’ );
    require( ABSPATH . WPINC . ‘/canonical.php’ );
    require( ABSPATH . WPINC . ‘/shortcodes.php’ );
    require( ABSPATH . WPINC . ‘/class-wp-embed.php’ ); <<<< add this
    require( ABSPATH . WPINC . ‘/media.php’ );
    require( ABSPATH . WPINC . ‘/http.php’ );
    require( ABSPATH . WPINC . ‘/class-http.php’ );

    For me, this was for an SVN upgrade. If you’re not using SVN, you can manually edit the above file and stop. If you’re using SVN and want more info on how to handle this via SVN, read on.

    The bigger issue I figured out is that wp-settings.php had a SVN conflict that never got resolved several updates ago:

    $ svn info wp-settings.php
    Path: wp-settings.php
    Name: wp-settings.php
    URL: http://core.svn.ww.wp.xz.cn/tags/3.1.2/wp-settings.php
    Repository Root: http://core.svn.ww.wp.xz.cn
    Repository UUID: 1a063a9b-81f0-0310-95a4-ce76da25c4cd
    Revision: 21100
    Node Kind: file
    Schedule: normal
    Last Changed Author: ryan
    Last Changed Rev: 16558
    Last Changed Date: 2010-11-23 16:19:38 -0800 (Tue, 23 Nov 2010)
    Checksum: 4d75ac52c641f9b5ec7165b700aecc5e
    Conflict Previous Base File: wp-settings.php.r15930
    Conflict Previous Working File: wp-settings.php.mine
    Conflict Current Base File: wp-settings.php.r17841

    I don’t use SVN much, so there may be better ways to resolve this, but what I did was:

    cp wp-settings.php wp-settings.php.hold
    svn remove –force wp-settings.php
    svn up wp-settings.php

    You can do a “diff -C 5 wp-settings.php.hold wp-settings.php” then to see what the changes were between your version and the repository’s one that you just updated to.

    Thread Starter mjm22178

    (@mjm22178)

    I finally figured this out, though I’m not sure why the old code worked with 2.0 and not 2.1. The answer is to call the function setup_postdata($post) immediately after the foreach. So, the final, working result is:

    <?php
    $random_posts = $wpdb->get_results($sql);
    foreach ($random_posts as $post) {
    setup_postdata($post);
    ?>
    <a href="<?php the_permalink(); ?>"
    title="<?php the_title(); ?>"><?php the_title();?></a><br/>
    Posted on <?php the_time('j F Y', display); ?>
    <?php the_excerpt(); ?>
    <?php
    }
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)