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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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