• The UCE plugin works as expected, but it breaks a hack that displays posts in a category in an iframe on another site.

    To explain: in the WP root there is a file, notheme.php which is called from another site like this:
    <iframe src="http://wp.mydomain.com/notheme.php"></iframe>

    file notheme.php

    <?php
    /* Alternate front to the WordPress application. This file loads
     * WordPress sans theme and reads posts from a specific category.
     * @package WordPress
     * @var bool
     */
    define('WP_USE_THEMES', false);
    require('./wp-load.php');
    query_posts ('cat=6');
    while (have_posts()):
      the_post();?>
      <h2><?php the_title(); ?></h2>
      <p><?php the_content(); ?></p><?php
    endwhile; ?>

    The category displays in the iframe, but not if it’s excluded from showing on the front-page with UCE.

    Clearly, when notheme.php runs, UCE senses that it is the front-page. How can I bypass UCE’s filter?

Viewing 5 replies - 1 through 5 (of 5 total)
  • What are you excluding your category (#6) from? When I used your code on my own web sites, the iframe works fine when loading from a different web site. I have the category excluded only from the main page. Ahh. When I exclude “From Archives” both the notheme.php and iframe don’t load anything at all.

    What version of WordPress, PHP, mysql are you using? I cannot recreate the notheme.php working, but the iframe not working. What web browser are you using? How about any proxies that may by trying to “help” you by filtering third party content?

    Thread Starter superpotion

    (@superpotion)

    I only mentioned iframe to explain what I was trying to do — there’s nothing wrong with the iframe part, that works as expected. For debugging you can forget iframe, just load notheme.php directly in the browser.

    Now, to answer your questions:

    In WordPress/UCE I excluded category (#6) from displaying in the main page only. The same category (#6) is the one I want to display on the other site using notheme.php, but nothing is displayed.

    For now I deactivated Ultimate Category Excluder and activated WP Hide Post (by Robert Mahfoud), and everything started working. But I’d prefer the simplicity of UCE for my bloggers (they just assign a category for their post and everything is taken care of).

    Here are the versions: WordPress 3.1, PHP 5.3, MySQL 5.1.36, Firefox 3.6.6 – and no proxies anywhere!

    Not shown in notheme.php, in the code snippet above, was the usual header and styling code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Newsfeed</title>
    <style type="text/css">

    :
    etc.
    :

    </style>
    </head>
    <body>

    If I change query_posts('cat=6'); to query_posts(); then all posts are displayed EXCEPT those excluded with UCE. Clearly the plugin’s logic determines that the main blog page is being displayed when notheme.php loads. (This may actually be a feature and NOT a bug!)

    Hope this helps.

    When I exclude my category from the Main page only in my test blog, The notheme.php page works just fine. Notheme shows the posts only in that category. The category disappears when I add in the exclusion “From Archives.” So on my setup, it is working correctly.

    And you are using version 0.6 of UCE, correct? Can you temporarily deactivate all of your other plugins to confirm that nothing else is running which might be causing a conflict? Mike

    Thread Starter superpotion

    (@superpotion)

    I deactivated all the other plugins, and the problem disappeared! I’ll pick though them to find the culprit. I feel a bit stupid for missing the obvious! Accept my apologies.

    Thanks for sharing your time, and for a great plugin.

    I’m glad you figured it out. When you find out what plugin it was, please let me know, just out of curiosity. Good luck hunting! Mike

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

The topic ‘[Plugin: Ultimate Category Excluder] Plugin breaks hack, please suggest workaround’ is closed to new replies.