theme.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. global $post;
  3. if (!defined('ABSPATH'))
  4. exit;
  5. $filters = array();
  6. if (!empty($theme_options['theme_categories'])) {
  7. $filters['category__in'] = $theme_options['theme_categories'];
  8. }
  9. if (empty($theme_options['theme_max_posts'])) {
  10. $filters['posts_per_page'] = 10;
  11. } else {
  12. $filters['posts_per_page'] = (int) $theme_options['theme_max_posts'];
  13. }
  14. if (!empty($theme_options['theme_post_types'])) {
  15. $filters['post_type'] = $theme_options['theme_post_types'];
  16. }
  17. $posts = get_posts($filters);
  18. ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
  19. <html>
  20. <head>
  21. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  22. <style type="text/css">
  23. </style>
  24. </head>
  25. <body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="background-color: #efefef;">
  26. <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
  27. <tr>
  28. <td align="center" valign="top">
  29. <table border="0" cellpadding="10" cellspacing="0" width="600" style="background-color: #FAFAFA;">
  30. <tr>
  31. <td valign="top">
  32. <table border="0" cellpadding="10" cellspacing="0" width="100%">
  33. <tr>
  34. <td valign="top" align="left" style="color: #505050;font-family: Arial;font-size: 10px;">
  35. You are receiving this email because you subscribed to <?php echo get_option('blogname'); ?>. <a href="{profile_url}">Click here to change your subscription</a>.
  36. </td>
  37. <td valign="top" width="190" align="left" style="color: #505050;font-family: Arial;font-size: 10px;">
  38. Is this email not displaying correctly?<br><a href="{email_url}" style="color: #336699;font-weight: normal;text-decoration: underline;">View it online</a>.
  39. </td>
  40. </tr>
  41. </table>
  42. </td>
  43. </tr>
  44. </table>
  45. <table border="0" cellpadding="0" cellspacing="0" width="600" bgcolor="#FFFFFF">
  46. <tr>
  47. <td align="center" valign="middle" height="150" style="color: #202020;font-family: Arial;font-size: 34px;font-weight: bold;line-height: 100%;padding: 5px 0 -2px 0;border-width: 1px 0px;border-style: solid;border-color: #dddddd;">
  48. <?php echo get_option('blogname'); ?>
  49. </td>
  50. </tr>
  51. </table>
  52. <table border="0" cellpadding="0" cellspacing="0" width="600" bgcolor="#FFFFFF">
  53. <tr>
  54. <td valign="top">
  55. <table border="0" cellpadding="20" cellspacing="0" width="200">
  56. <tr>
  57. <td valign="top" align="left" style="color: #505050;font-family: Arial;font-size: 12px;line-height: 150%;">
  58. Sidebar text
  59. </td>
  60. </tr>
  61. <?php
  62. if (!isset($theme_options['theme_social_disable'])) {
  63. $social_icon_url = plugins_url('emails/themes/default/images', 'newsletter/plugin.pnp');
  64. ?>
  65. <tr>
  66. <td valign="top" align="left">
  67. <?php
  68. foreach (array('facebook', 'twitter', 'youtube', 'linkedin', 'googleplus', 'pinterest', 'tumblr', 'instagram') as $social) {
  69. if (empty($theme_options["theme_$social"]))
  70. continue;
  71. ?>
  72. <a href="<?php echo $theme_options["theme_$social"]; ?>"><img src="<?php echo $social_icon_url; ?>/<?php echo $social; ?>.png" alt="<?php echo $social; ?>"></a>
  73. <?php } ?>
  74. </td>
  75. </tr>
  76. <?php } ?>
  77. </table>
  78. </td>
  79. <td valign="top">
  80. <table border="0" cellpadding="20" cellspacing="0" width="100%" bgcolor="#ffffff">
  81. <tr>
  82. <td valign="top">
  83. <?php foreach ($posts as $post) {
  84. setup_postdata($post);
  85. ?>
  86. <h2 style="color: #202020;font-family: Arial;font-size: 20px;font-weight: bold;margin-top: 0;margin-bottom: 10px;border-bottom: 1px solid #efefef;">
  87. <?php the_title(); ?>
  88. </h2>
  89. <center><img src="<?php echo newsletter_get_post_image($post->ID, 'medium'); ?>"></center>
  90. <div style="color: #505050;font-family: Arial;font-size: 14px;line-height: 150%;">
  91. <?php the_excerpt(); ?>
  92. </div>
  93. <?php } ?>
  94. </td>
  95. </tr>
  96. </table>
  97. </td>
  98. </tr>
  99. </table>
  100. </td>
  101. </tr>
  102. </table>
  103. <br><br>
  104. </body>
  105. </html>