Thread Starter
Lock
(@locksoft)
This is the plugin SQL:
SELECT post_modified, post_title, id FROM wp_eq_posts WHERE post_type <> ‘revision’ AND post_type <> ‘attachment’ AND post_type <> ‘nav_menu_item’ AND post_type<>’tablepress_table’ AND post_type <> ‘acp-order-summary’ AND post_type <> ‘acp-links’ AND post_type<>’acp-orders’ AND post_status = ‘publish’ AND id NOT IN (SELECT * FROM (SELECT id FROM wp_eq_posts WHERE post_type <> ‘revision’ AND post_type <> ‘attachment’ AND post_type <> ‘nav_menu_item’ AND post_type<>’tablepress_table’ AND post_status = ‘publish’ ORDER BY post_date DESC LIMIT 10) AS temp) ORDER BY post_modified DESC LIMIT 10
I can’t understand why some elements from the second SELECT are excluded:
***AND id NOT IN*** (SELECT * FROM (SELECT id FROM wp_eq_posts WHERE post_type <> ‘revision’ AND post_type <> ‘attachment’ AND post_type <> ‘nav_menu_item’ AND post_type<>’tablepress_table’ AND post_status = ‘publish’ ORDER BY post_date DESC LIMIT 10) AS temp)
Why? Executing this query only I see all the articles I need, that’s why they don’t appear in the list. Is there a reason for that?
Thread Starter
Lock
(@locksoft)
Ok, I understood.
You’re automatically excluding the last X published articles because usually there’s a widget that already shows them. But I don’t use it as the site main page (index) already shows the last articles.
is there a possibility you could update the plugin with a choice about this (“show X last updated” or “show X last updated that are not in the last X published”, as it’s now)?
For the moment I’m going to change the query but it would be very nice if you could include this change. 🙂
Have a nice day,
Lock
Thread Starter
Lock
(@locksoft)
P.S. On my website I’ve changed the SQL query in:
SELECT post_modified, post_title, id FROM $wpdb->posts
WHERE post_type <> ‘revision’ AND post_type <> ‘attachment’ AND post_type <> ‘nav_menu_item’ AND post_type<>’tablepress_table’
AND post_type <> ‘acp-order-summary’ AND post_type <> ‘acp-links’ AND post_type<>’acp-orders’ AND post_status = ‘publish’
ORDER BY post_modified DESC
LIMIT $nb_display
So now you’ll see the list correct, but I’d really appreciate an update in the plugin because I don’t like to edit other people work. 🙂
Good evening
is there a possibility you could update the plugin with a choice about this (“show X last updated” or “show X last updated that are not in the last X published”, as it’s now)?
Yes, it is possible, but this will require a bit of time because I’m a bit busy at the moment.
On the other hand, the text is a bit long, can you express this choice of way more succinct?
A choice may be like this:
Show the latest updates:
- which are not the latest publications
- which may be the latest publications
Another idea of formulation?
Thread Starter
Lock
(@locksoft)
Eh eh, that’s difficult, especially because none of us are english. 🙂
I’d say something like:
Show:
- All updated posts
- All but last X published posts
where X may be the same number of shown posts or another value for more customized views.
Maybe also adding a small description text because it’s not a simple concept to summarize in a combo box. 🙂
Don’t worry about time, it’s not urgent.
Many thanks for the quick reply. 🙂
Perhaps a simple checkbox like this:
■ Except the X last publication
Where X = 0 to display any updated posts.
X = 1 to display them all, but not the last published post.
X = 2 to display them all, but not the last two posts published.
etc.
Another idea of formulation?
Thread Starter
Lock
(@locksoft)
Perfect. 🙂
0 = display all post
X>0 = exclude the last X posts.
It is more convenient to choose the number X at the beginning of text or at the end of text.
So maybe this:
X Latest articles published excluded (where X is the number).
Or perhaps:
Last articles excluded X
X = 0 to display any updated articles.
X = 1 for all display, but not the last published article.
X = 2 to display them all, but not the last two articles published.
etc.
What do you think ?
The new version 1.5 allows to choose the number of exclusion.
Thread Starter
Lock
(@locksoft)
Just installed it, that’s perfect! 🙂
Many thanks, Luciole, very kind of you.
Have a nice day,
Lock
Thread Starter
Lock
(@locksoft)
(sorry about your last message, I totally missed it but your solution is pretty good). 🙂