Advertisement
wpnimitz

Get Post Meta in conditional Tag

Sep 18th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. function freebie_wednesday($content) {
  2. if (is_user_logged_in() && in_category('freebies')) {
  3. $content .= '<div class="message success-freebie">';
  4. $content .= 'Congratulations, as a member you can claim your freebie ';
  5. $content .= '<a href="#">here</a>';
  6. $content .= '</div>';
  7. $content .= '<br />';
  8. $content .= '<div class="message warning">My beautiful waning message goes here.</div>';
  9. }
  10.  
  11. elseif (in_category('freebies'))
  12. {
  13. $content .= '<div class="message error-freebie">';
  14. $content .= 'Sorry, our freebies are intended for registered user, please login <a href="/wp-login.php">here</a>';
  15. $content .= '</div>';
  16.  
  17. }
  18. return $content;
  19.  
  20. }
  21. add_filter('the_content','freebie_wednesday');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement