theme.php 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /*
  3. * Some variables are already defined:
  4. *
  5. * - $theme_options An array with all theme options
  6. * - $theme_url Is the absolute URL to the theme folder used to reference images
  7. * - $theme_subject Will be the email subject if set by this theme
  8. *
  9. */
  10. global $newsletter, $post;
  11. if (!defined('ABSPATH')) exit;
  12. $filters = array();
  13. if (!empty($theme_options['theme_categories'])) {
  14. $filters['category__in'] = $theme_options['theme_categories'];
  15. }
  16. if (empty($theme_options['theme_max_posts']))
  17. $filters['posts_per_page'] = 9;
  18. else
  19. $filters['posts_per_page'] = (int) $theme_options['theme_max_posts'];
  20. $posts = get_posts($filters);
  21. ?><!DOCTYPE html>
  22. <html>
  23. <head>
  24. </style>
  25. </head>
  26. <body style="background-color: #eee; background-image: url('<?php echo $theme_url; ?>/images/bg.jpg'); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; color: #666; margin: 0 auto; padding: 0;">
  27. <br>
  28. <table align="center">
  29. <tr>
  30. <td align="center">
  31. <small><a target="_tab" href="{email_url}" style="color: #666; text-decoration: none">View this email online</a></small>
  32. <br>
  33. <div style="color: #b00; font-size: 50px; font-family: serif; font-style: italic;">
  34. <?php echo get_option('blogname'); ?>
  35. </div>
  36. <br>
  37. <br>
  38. <table cellpadding="5">
  39. <tr>
  40. <?php for ($i=0; $i<3; $i++) { $post = $posts[$i]; setup_postdata($post); ?>
  41. <td align="center" valign="top">
  42. <a target="_tab" href="<?php echo get_permalink(); ?>" style="font-size: 14px; line-height: 26px; font-weight: bold; color: #000; text-decoration: none"><?php echo substr(get_the_title(), 0, 25); ?>...</a><br>
  43. <a target="_tab" href="<?php echo get_permalink(); ?>" style="display: block; width: 200px; height: 170px; overflow: hidden"><img width="200" src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>" alt=""></a>
  44. </td>
  45. <?php } ?>
  46. </tr>
  47. <tr>
  48. <?php for ($i=3; $i<6; $i++) { $post = $posts[$i]; setup_postdata($post); ?>
  49. <td align="center" valign="top">
  50. <a target="_tab" href="<?php echo get_permalink(); ?>" style="font-size: 14px; line-height: 26px; font-weight: bold; color: #000; text-decoration: none"><?php echo substr(get_the_title(), 0, 25); ?>...</a><br>
  51. <a target="_tab" href="<?php echo get_permalink(); ?>" style="display: block; width: 200px; height: 170px; overflow: hidden"><img width="200" src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>" alt=""></a>
  52. </td>
  53. <?php } ?>
  54. </tr>
  55. <tr>
  56. <?php for ($i=6; $i<9; $i++) { $post = $posts[$i]; setup_postdata($post); ?>
  57. <td align="center" valign="top">
  58. <a target="_tab" href="<?php echo get_permalink(); ?>" style="font-size: 14px; line-height: 26px; font-weight: bold; color: #000; text-decoration: none"><?php echo substr(get_the_title(), 0, 25); ?>...</a><br>
  59. <a target="_tab" href="<?php echo get_permalink(); ?>" style="display: block; width: 200px; height: 170px; overflow: hidden"><img width="200" src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>" alt=""></a>
  60. </td>
  61. <?php } ?>
  62. </tr>
  63. </table>
  64. <br><br>
  65. <?php
  66. if (!isset($theme_options['theme_social_disable'])) {
  67. include WP_PLUGIN_DIR . '/newsletter/emails/themes/default/social.php';
  68. }
  69. ?>
  70. <small>To change your subscription, <a target="_tab" href="{profile_url}" style="color: #666; text-decoration: none">click here</a></small>
  71. </td>
  72. </tr>
  73. </table>
  74. </body>
  75. </html>