No Future Posts

Diese Plugin ändert den Post Status von "future" auf "publish".

Warum? Normalerweise werden Einträge, die in der Zukunft liegen von WordPress ausgefiltert. Das hat den Vorteil, dass man Beiträge schreiben kann, die automatisch erst zu einem gewählten späteren Zeitpunkt veröffentlicht werden. Nachteil des Ganzen ist aber, dass man keine Termine einblenden kann. Durch mein Plugin werden nun auch vordatierte Beiträge ganz normal angezeigt.

Ausnahmen (Status bleibt "future") können per Artikel oder per Kategorie angegeben werden.

Momentane Probleme:

  • Die Post-Anzahl in der Kategorieliste ignoriert diese Manipulation da sie einen eigenen Filter nach post-datum benutzt. Aber die Zahlen kann man ja ausblenden. ;)
  • Um die Posts auch im Kalender(-Widget) anzuzeigen muss man an die Core-Dateien da auch hier eine eigene Abfrage benutzt wird. Siehe Patch unten.

Download bei WordPress

Calendar Patch:

To show the future posts in the calendar widget too you have to edit wp-includes/general-template.php about row 1181 (WordPress 3.0.1).

Look for

$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
AND YEAR(post_date) = '$thisyear'
AND post_type = 'post' AND post_status = 'publish'
AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);

and change to

$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
AND YEAR(post_date) = '$thisyear'
AND post_type = 'post' AND post_status = 'publish' ", ARRAY_N); 

No Future Posts 1.2.1

Contributors: Tom Braider
Donate link: www.unicef.org
Tags: posts, future, events
Requires at least: 2.0
Tested up to: 2.8
Stable tag: 1.2.1

Changes the post status from "future" to "publish".

Description


Changes the status of all posts from "future" to "publish".
So future posts will show in your blog like other posts.
I use it to show events. No calendar plugin is needed.

Exclude liste for posts and categories.

Installation

  1. unzip plugin directory into the /wp-content/plugins/ directory
  2. activate the plugin through the Plugins menu in WordPress
  3. fill the exclude lists on options page

Frequently Asked Questions


Need Help? Find Bug?


read and write comments on plugin page

Screenshots


Arbitrary section


Known Issues
  • post counter in the category list ignores future posts because it is using the post_date
  • plugin "Customizable Post Listings" must change because it is using it own sql-query

Changelog


1.2.1
1.2
  • new: uninstall function for wp 2.7
1.1
  • new: exclude lists for posts and categories
  • new: languages english, german
1.0
  • first release
created by Readme Parser
$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts WHERE MONTH(post_date) = '$thismonth'
AND YEAR(post_date) = '$thisyear'
AND post_type = 'post' AND post_status = 'publish'
AND post_date < '" . current_time('mysql') . '\'', ARRAY_N);

RSS-Feed 33 Kommentare

alle Kommentare anzeigen / show all comments
  1. Mike Mike sagt:

    :thumbsup: tanks for useful wordpress plugin !
    Just a question / upgrade : How can I have the future post in the calendar wiget too ? Because the DB update permit to see post content but the calendar only show past to present event.

  2. Tom Tom sagt:

    Hi Mike,
    I think the widget uses its own DB query to select the latest posts. Maybe the "post-date" that wasn't change by my plugin.

  3. Very handy plug-in! I'm with Mike, though, and think if it could show the post in the calendar widget as well, that would just be spectacular. Any chance you'll be adding this feature?

  4. Tom Tom sagt:

    Maybe. :gruebel: I must see how the widget works. Maybe it is possible to change it by the plugin.

  5. Tom Tom sagt:

    You can change the WP file general-template.php (see patch above) to show the future posts in the calender too.

  6. Oh man, you're the greatest! Thanks so much for coming up with that so fast!

    You rule. :thumbup:

  7. Hey tom. Still loving the plug-in, but I had another idea for it I was wondering if you might be interested to try. I wish I knew anything about the coding of these plugins, but you seem pretty good at it!

    Anyway, I was wondering if there would be a way to show future posts for some categories, but not others. So if say you want to show posts in the category "Events" from future dates, but posts from category "Reviews" would not show posts from future dates.
    Also, in the same line of thinking, maybe there would be a way to show future posts on some Pages and not others.

    Hopefully that makes sense, but you were so quick at getting the calendar patch figured out, I thought maybe you could work this one out too. I'm still new to WordPress, but it's growing on me!

  8. Tom Tom sagt:

    Oh my goodness! :-O ;-) You wish to exclude categories? Ok, i will think about it.
    But what do you mean with "to show future posts on some Pages and not others."? Do you want to keep some posts in future status? It's another exclude list, isn't it?

  9. Yes, that's what I mean. Just another exclude list.

    I'm interested to see what you can come up with! :gruebel:

Kommentare Seite:123»
alle Kommentare anzeigen / show all comments

Kommentar schreiben




Tiny Corner