Testing monthly template (more than one random post)

38 views
Skip to first unread message

mawksey

unread,
Aug 30, 2010, 4:40:28 AM8/30/10
to MailPress
I was recently creating a monthly template and like other users was
struggling to test it because MailPress only pulls in a single random
old post. My workaround was to get the plugin to send a test mail with
my last 10 posts (based on my WP reading settings). Here is how I did
it:

Open the file /mailpress/mp-admin/settings/test.php and change the
lines (around line 68ish):

$posts = $wpdb->get_results( "SELECT ID, post_title FROM $wpdb->posts
WHERE post_status = 'publish' AND post_type = 'post' ORDER BY RAND()
LIMIT 1;" );

to

$posts = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE
post_status = 'publish' AND post_type = 'post';" );

and

query_posts('p='. $posts[0]->ID);

to

query_posts($posts);

To send a test email use the Settings -> MailPress -> Test and choose
'monthly' as the template

Reply all
Reply to author
Forward
0 new messages