Forum Replies Created

Viewing 15 replies - 286 through 300 (of 324 total)
  • Forum: Plugins
    In reply to: Temporary posts…

    Did you ever find a plugin that does this?

    I would also like similar functionality!

    Thanks adam-s

    Using WP2.5, in the Main Index Template of my theme, I added these lines:
    <!– This reverses the order of post display from Oldest to Newest for things like events –>
    <?php query_posts($query_string . “&order=ASC”); ?>

    just before the this line:
    <!–the loop–>

    and it reversed the order!

    I also installed the plugin ‘the future is now’ which allows future dated posts to be displayed:
    http://wordpress.org/extend/plugins/the-future-is-now/#post-2682

    So now I can date my events with their actual date, and they will show up in the order they should (from most current to the farthest away).

    Any plugins out there that can be used to auto-delete (or auto-unpublish) a post on specific date, so I don’t have to manually remember to go and remove it once the event has passed?

    Thanks

    Thread Starter Jeff Sherk

    (@jsherk)

    Okay otto42, that did partially solve the problem… I used the query_posts() and put the 2.5 version of rewrite.php back and the code now works with permalinks set custom.

    But now another problem has shown up, which involves multiple installs of WP.

    I have two seperate blog installs at mydomain.com/blog1 and mydomain.com/blog2. Note that mydomain.com is outside all the WP installs.

    An external program that tries to pull the posts out of each blog, always gets the blog1 posts, even when it should be getting blog2 posts. Here’s how to recreate:

    Take the following code:

    <?php
    //Displays the title of the 3 most recent posts in the blog
    require('./wp-blog-header.php');
    query_posts('showposts=3');
    if (have_posts()) : while (have_posts()) : the_post();
    the_title();
    ?><br />
    <?php endwhile; endif; ?>

    Save it as BlogOnePosts.php and upload it to mydomain.com/blog1 directory. Now save the same code again as BlogTwoPosts.php and upload it to mydomain.com/blog2 directory.

    Go to both mydomain.com/blog1/BlogOnePosts.php and then mydomain.com/blog2/BlogTwoPosts.php and you will see that they each correctly display the last three posts for each blog seperately.

    Now take this code:

    Blog 1<br />
    <?php include('/home/public_html/blog1/BlogOnePosts.php'); ?>
    <br /><br />
    Blog 2<br />
    <?php include('/home/public_html/blog2/BlogTwoPosts.php'); ?>

    Save it as BlogPosts.php and upload it to your mydomain.com directory (outside both wordpress installs).

    Now goto mydomain.com/BlogPosts.php

    You will probably get an error message:
    WARNING: require('./wp-blog-header') No Such File Or Directory
    Not sure if this is expected behaviour, but here’s how we fix it…

    In the BlogOnePosts.php change this line:
    require('./wp-blog-header.php');
    to this line:
    require('/home/public_html/blog1/wp-blog-header.php');

    Now in the BlogTwoPosts.php change this line:
    require('./wp-blog-header.php');
    to this line:
    require('/home/public_html/blog2/wp-blog-header.php');

    Now got back to mydomain.com/BlogPosts.php, and you see that Blog 1 shows the three most recent posts correctly, but Blog 2 shows the three most recent posts from Blog 1 as well instead of it’s own posts.

    Fixed one problem… on to the next one!!!

    Thread Starter Jeff Sherk

    (@jsherk)

    Obviously, going back to an older version of a file is not the perfect solution, and I don’t know what other problems it may cause, so be sure to check your site (permalinks, rss feeds, etc) to make sure everything else is still working!

    Thread Starter Jeff Sherk

    (@jsherk)

    Okay, I determined that the problem is somehow related to the includes/rewrite.php file.

    The following short-term solution worked for me:

    (1) Get a copy of rewrite.php from WP2.3.3 version here:
    http://trac.wordpress.org/browser/branches/2.3/wp-includes/rewrite.php?format=raw

    (2) Open it in a text editor, and comment out line 903 by putting two slashes (//) in front of it, so the line looks like this:
    //generate_page_uri_index();

    (3) In your current WP2.5 install, rename the includes/rewrite.php file to something like includes/rewrite.php.ORIG

    (4) Upload the modified v2.3.3 rewrite.php file to the includes directory.

    (5) Now go to the admin panel in WordPress and choose settings then permalinks. Change the setting back to default and hit save. Now choose your custom permalinks setting and hit save again.

    If the problem is solved great!!!

    If not, go delete the rewrite.php that you uploaded, rename the rewrite.php.ORIG back to rewrite.php, goto permalink settings and change it back to default and hit save.

    Hope this helps somebody!!!

    Thread Starter Jeff Sherk

    (@jsherk)

    This issue has been left open in the tracker for now.

    It is somehow related to the permalinks setting. When set to default, the code below works fine, but when set to custom have_posts returns empty.

    <?php
    //Displays the title of the 3 most recent posts in the blog
    $posts_per_page = 3;
    require('./wp-blog-header.php');
    if (have_posts()) : while (have_posts()) : the_post();
    the_title();
    ?><br /><?php
    endwhile; else:
    endif;
    ?>

    Tracker issue:
    http://trac.wordpress.org/ticket/6484

    If you are not using default permalinks, change the setting back to default permalinks and see if the problem goes away. There is something weird that custom permalinks is doing on some blogs!!!

    Thread Starter Jeff Sherk

    (@jsherk)

    Yes, when I turn the permalinks back to default it starts working again, but when I set the permalinks back to ‘day and name’ it stops working again…

    Something weird here!!!

    Wonder if this is related to my have_posts function problem?? See here…

    http://wordpress.org/support/topic/164871

    Thread Starter Jeff Sherk

    (@jsherk)

    I opened a ticket in the tracker… here is the link:

    http://trac.wordpress.org/ticket/6484

    Thread Starter Jeff Sherk

    (@jsherk)

    Scooby, I tested your code (had to add require(‘wp-blog-header.php’); at the top) and confirm that it does the same thing on my system… spits out Not Found!!!

    Thread Starter Jeff Sherk

    (@jsherk)

    Scooby, are your blog pages (main posts) working fine?

    have_posts seems to work in ‘the loop’ for me, but not in it’s own seperate program!

    If it still doesn’t work after you try re-doing WP 2.5 I suggest going back to WP 2.3.3 until further troubleshooting can be used.

    Whenever I do an upgrade, I use FTP (FileZilla).

    I deactivate all the plugins.

    I then upload the new WordPress right over top of the old one (I don’t delete anything except hello-dolly.php in the plugins directory). The only file that I’m aware of that needs to be preserved is the config.php file, but there usually shouldn’t be one in the new WordPress to overwrite the old one.

    Once the upload is complete, you goto http://…/blogname/wp-admin/upgrade.php and it will make any necessary changes to the database and you should be good to go.

    I would suggest you re-download WP 2.5 from the WordPress site and then re-upload it over top of whatever is on your site to make sure all the files got transfered properly.

    Thread Starter Jeff Sherk

    (@jsherk)

    Okay, just so I know I’m not crazy, try this piece of code:

    <?php
    require('wp-blog-header.php');
    $myid=10; //put a post id here that you know is valid
    $mytest = get_post($myid);
    echo "Known good post id ".$myid." returns: ".$mytest->post_title;
    $mytest = have_posts();
    if ($mytest=="") { $mytest="nothing"; }
    echo " and have_posts() returns: ".$mytest;
    ?>

    If you stick a Post ID number in that you know is valid, it will correctly display the title, yet the have_posts() returns empty!

    Any suggestions anybody?

Viewing 15 replies - 286 through 300 (of 324 total)