Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter jamesbisset

    (@jamesbisset)

    Thanks Lester,

    Tracked it down to a missing pair of double quote marks on the Simplemag theme:

    line 461 of simplemag/js/jquery.custom.js

    [href^=#comments] should be [href^=“#comments”]

    Tsk.

    jamesbisset

    (@jamesbisset)

    Same thing happening here.

    It turns out that filter_var() is a function available only in PHP 5.2 and above. Despite the fact that the Installation page says requirements PHP 5.1 or above.

    I thought WordPress had its own sanitising filters?

    PHP 5.2 was released in November 2006, so your host is either very out of touch or protecting legacy sites which might otherwise fall over. And if they haven’t updated yet there’s probably a good reason.

    Running 2.7 and the same thing happened to me. Plugin admin page wouldn’t load unless there were no plugins in the plugin folder. Even hello.php was enough to trigger it.

    Safari would instead display a ‘server dropped connection’ message. Firefox loaded a blank page. And yet a duplicate version of the site running on my Mac loaded fine.

    In my case too, the hosting company had migrated the site to a new server, which had a different absolute path “/var/www/<domain>/httpdocs” – previously it had been “/web/guide/<username>/public-html”.

    I installed a vanilla WP in a subdirectory on the same site and it worked fine with a duplicate set of plugins.

    So I bit the bullet and updated to 2.8.4, hoping that the database upgrade would clean out whatever was screwing the site.

    It worked. ??

    Thread Starter jamesbisset

    (@jamesbisset)

    Rushing to judgement. Tsk!

    The value returned by __FILE__ is:
    /content/package/m/y/mydomain.com/web/wp-content etc

    while the value returned by WP_CONTENT_DIR is:
    /content/package/m/y/www.mydomain.com/web/wp-content etc

    ie __FILE__ supplies a different value to DOCUMENT_ROOT.

    Thread Starter jamesbisset

    (@jamesbisset)

    The database doesn’t update because register_activation_hook() also calls on __FILE__.

    Obvious really.

    I’ve managed to get it working by replacing __FILE__ with $path_to_file where:

    $path_to_file = WP_CONTENT_DIR . '/plugins/stray-quotes/stray_quotes.php';

    It works, but it doesn’t explain why WordPress can parse one and not the other, when the value returned would appear to be the same in both cases.

    Thread Starter jamesbisset

    (@jamesbisset)

    Thanks for the reply Otto.

    I know the direct route and that’s what I used to get the install to work. And I’ll probably start implementing the WP_SITEURL and WP_HOME too, although as you say, plugins still won’t necessarily play by the rules.

    I’m trying to standardise a site structure that allows for quick and easy WordPress updates, without the risk of deleting wp-content in the process. Or for that matter, downloading wp-content and then uploading it all over again, once WordPress has been re-installed.

    Unzipping directly on the server is the straightforward way, but it’s just not an option on many shared servers.

    Thread Starter jamesbisset

    (@jamesbisset)

    Thanks for the information and the links.

    It seems a good idea in principle to separate the wordpress engine from the customised wp-content and wp-config.php. Makes upgrading on shared servers without SSH much more straightforward, and the site (possibly) a little more secure.

    But it does seem that it’s not just a straight-forward code tweak for developers.

    jamesbisset

    (@jamesbisset)

    OK – I modified your query slightly using

    AND post_status = 'publish'
    ORDER BY menu_order

    and used $post.

    Same result as before – I get the auto-generated excerpts, not my explicit excerpts.

    FWIW, it works fine for me without using unset(). But I’m using this code in a template file outside and after the loop, so I don’t think there are any issues there.

    You’ve seen the thread I opened on exactly the issue of auto vs explicit excerpts. I’m still using your $pageChild successfully with Kafkaesqui’s recommended

    <?php echo apply_filters('the_excerpt', $pageChild->post_excerpt); ?>

    You can see the result here.

    jamesbisset

    (@jamesbisset)

    Thanks mfields. ??

    I can see a plugin coming on…

    Thread Starter jamesbisset

    (@jamesbisset)

    We have a result!

    Thanks. So, I now have a working solution, but it’s a workaround and it does mean that something funky is happening inside setup_postdata().

    Do I mark this thread ‘resolved’ or should I leave it open for a day or two?

    Thread Starter jamesbisset

    (@jamesbisset)

    Thanks for this.

    Curiouser and curiouser… Now I do get exactly nothing – well I get a <br /> in the space where the excerpt is supposed to go. In the second version of the function above I get an indented <br />.

    Thread Starter jamesbisset

    (@jamesbisset)

    Doh!

    OK <cough> – echo out get_the_excerpt() and again I get the auto-generated excerpt instead of my explicit saved excerpt.

    To be clear, I can see my excerpt if it’s called using the usual methods inside the loop, so I know it exists and that WordPress can display it.

    My guess would be that either $wpdb->get_results() is losing post_excerpt or that setup_postdata() is ignoring it. The latter seems more likely, but I can’t find any documentation on setup_postdata() and I don’t know enough about WordPress to make sense of it in query.php (line 1494)

    jamesbisset

    (@jamesbisset)

    I’m not sure if I made sense in the post above, so I’ve tweaked the example pages to illustrate where things are going wrong more succinctly.

    The parent page in the link displays a hard coded example of how I want the page to look. I’ve created excerpts for each child page to match and enabled html in the_ excerpt().

    Below the hard coded example are excerpts called by ‘mfields’ code listed earlier in this thread. As you can see, the excerpt is an auto generated excerpt using a portion of the post, ignoring my custom excerpt.

    However, if you click through to any of the child pages, you’ll see that WordPress is quite happy to display my custom excerpt in the_excerpt() within the loop.

    NB: I’ve used both advanced-excerpt and excerpt-editor plugins to create, manage and display html excerpts. WordPress 2.3.1 seems to be quite happy to display html excerpts without the use of either – unless my ISP is doing some funky caching thang.

    Does anyone know what’s going on?

    jamesbisset

    (@jamesbisset)

    mfields said: I think I might have a solution to this (WP v2.2):

    This is very close to being just the right solution. ??

    I don’t know if it’s WordPress 2.3.1 which has broken it, but the excerpts this code presents seem to ignore my custom excerpts and create default ones from the content.

    You can see what’s happening on this site in development. The top half shows what I’m trying to achieve but it’s all manually coded into the post. The bottom half shows the auto-generated version using the code posted above. The first entry in the bottom half has a custom excerpt to match the hand-written version above. But instead I get the default.

    However, I can still view that custom excerpt in a normal page if I replace the_content() with the_excerpt() in the template.

    Anyone know what’s going wrong?

    1) For any attempts to use valid object tags with Flash content see
    <https://www.alistapart.com/articles/flashsatay/&gt;
    or search alistapart for “satay”. There’s a bunch of stuff on there about the object tag and multi-media content.

    2) TJworld’s solution was the one that solved the problem, but running WordPress 2.0.5, I found that what worked for me was looking in “wp-includes/functions-formatting.php” and adding “object|” to any instance of
    preg_replace('!(</?(?:table|thead|tfoot|...

Viewing 15 replies - 1 through 15 (of 19 total)