Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_source_and_via() {
- if (!$this->is_single) {
- return;
- }
- $buffy ='';
- //via and source
- 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'])) {
- $via_url = '#';
- $source_url = '#';
- $credit_url ='#';
- // used to check is post have tags to align the source and via container
- $td_no_tags = '';
- if (!has_tag()) {
- $td_no_tags = 'td-no-tags';
- }
- if (!empty($this->td_post_theme_settings['td_via_url'])) {
- $via_url = $this->td_post_theme_settings['td_via_url'];
- }
- if (!empty($this->td_post_theme_settings['td_source_url'])) {
- $source_url = $this->td_post_theme_settings['td_source_url'];
- }
- if (!empty($this->td_post_theme_settings['td_credit'])) {
- $credit_url = $this->td_post_theme_settings['td_credit'];
- }
- $buffy .= '<div class="td-post-source-via ' . $td_no_tags . '">';
- if (!empty($this->td_post_theme_settings['td_via'])) {
- $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>';
- }
- if (!empty($this->td_post_theme_settings['td_source'])) {
- $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>';
- }
- if (!empty($this->td_post_theme_settings['td_credit'])) {
- $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>';
- }
- $buffy .= '</div>';
- }
- return $buffy;
- }
Advertisement
Add Comment
Please, Sign In to add comment