Guest User

Untitled

a guest
Feb 24th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. function get_source_and_via() {
  2. if (!$this->is_single) {
  3. return;
  4. }
  5.  
  6.  
  7. $buffy ='';
  8.  
  9. //via and source
  10. if (!empty($this->td_post_theme_settings['td_source']) or !empty($this->td_post_theme_settings['td_via']) or !empty($this->td_post_theme_settings['td_credit'])) {
  11. $via_url = '#';
  12. $source_url = '#';
  13. $credit_url ='#';
  14.  
  15. // used to check is post have tags to align the source and via container
  16. $td_no_tags = '';
  17. if (!has_tag()) {
  18. $td_no_tags = 'td-no-tags';
  19. }
  20.  
  21. if (!empty($this->td_post_theme_settings['td_via_url'])) {
  22. $via_url = $this->td_post_theme_settings['td_via_url'];
  23. }
  24.  
  25. if (!empty($this->td_post_theme_settings['td_source_url'])) {
  26. $source_url = $this->td_post_theme_settings['td_source_url'];
  27. }
  28.  
  29. if (!empty($this->td_post_theme_settings['td_credit'])) {
  30. $credit_url = $this->td_post_theme_settings['td_credit'];
  31. }
  32.  
  33. $buffy .= '<div class="td-post-source-via ' . $td_no_tags . '">';
  34. if (!empty($this->td_post_theme_settings['td_via'])) {
  35. $buffy .= '<div class="td-post-small-box"><span>' . __td('VIA', TD_THEME_NAME) . '</span><a rel="nofollow" href="' . esc_url($via_url) . '">' . $this->td_post_theme_settings['td_via'] . '</a></div>';
  36. }
  37.  
  38. if (!empty($this->td_post_theme_settings['td_source'])) {
  39. $buffy .= '<div class="td-post-small-box"><span>' . __td('SOURCE', TD_THEME_NAME) . '</span><a rel="nofollow" href="' . esc_url($source_url) . '">' . $this->td_post_theme_settings['td_source'] . '</a></div>';
  40. }
  41.  
  42. if (!empty($this->td_post_theme_settings['td_credit'])) {
  43. $buffy .= '<div class="td-post-small-box"><span>' . __td('CREDIT', TD_THEME_NAME) . '</span><a rel="nofollow" href="' . esc_url($credit_url) . '">' . $this->td_post_theme_settings['td_credit'] . '</a></div>';
  44. }
  45.  
  46.  
  47. $buffy .= '</div>';
  48. }
  49.  
  50.  
  51. return $buffy;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment