Esempio n. 1
0
 /**
  * Create the post footer
  * 
  * Override: childtheme_override_postfooter <br>
  * Filter: thematic_postfooter
  */
 function thematic_postfooter()
 {
     $post_type = get_post_type();
     $post_type_obj = get_post_type_object($post_type);
     // Check for "Page" post-type and logged in user to show edit link
     if ($post_type == 'page' && current_user_can('edit_posts')) {
         $postfooter = '<div class="entry-utility">' . thematic_postfooter_posteditlink();
         $postfooter .= "</div><!-- .entry-utility -->\n";
         // Display nothing for logged out users on a "Page" post-type
     } elseif ($post_type == 'page') {
         $postfooter = '';
         // For post-types other than "Pages" press on
     } else {
         $postfooter = '<div class="entry-utility">';
         if (is_single()) {
             $post_type_archive_link = function_exists('get_post_type_archive_link') ? get_post_type_archive_link($post_type) : home_url('/?post_type=' . $post_type);
             if (thematic_is_custom_post_type() && $post_type_obj->has_archive) {
                 /* translators: %s is custom post type singular name, wrapped in link tags */
                 $postfooter .= sprintf(__('Browse the %s archive.', 'thematic'), ' <a href="' . $post_type_archive_link . '" title="' . sprintf(esc_attr__('Permalink to %s Archive', 'thematic'), $post_type_obj->labels->singular_name) . '">' . $post_type_obj->labels->singular_name . '</a>');
                 $postfooter .= ' ';
             }
             $postfooter .= thematic_postfooter_posttax();
             $postfooter .= sprintf(_x('Bookmark the %1$spermalink%2$s.', '1s and 2s are the a href link wrappers, do not reverse them', 'thematic'), sprintf('<a title="%s" href="%s">', sprintf(esc_attr__('Permalink to %s', 'thematic'), the_title_attribute('echo=0')), apply_filters('the_permalink', get_permalink())), '</a>') . ' ';
             if (post_type_supports($post_type, 'comments')) {
                 $postfooter .= thematic_postfooter_postconnect();
             }
         } elseif (post_type_supports($post_type, 'comments')) {
             $postfooter .= thematic_postfooter_posttax();
             $postfooter .= thematic_postfooter_postcomments();
         }
         // Display edit link
         if (current_user_can('edit_posts')) {
             if (!is_single() && post_type_supports($post_type, 'comments')) {
                 $postfooter .= "\n\n\t\t\t\t\t\t" . '<span class="meta-sep meta-sep-edit">|</span> ';
             }
             $postfooter .= ' ' . thematic_postfooter_posteditlink();
         }
         $postfooter .= "\n\n\t\t\t\t\t</div><!-- .entry-utility -->\n";
     }
     // Put it on the screen
     echo apply_filters('thematic_postfooter', $postfooter);
     // Filter to override default post footer
 }
 function thematic_postfooter_postconnect()
 {
     $postconnect = __('. Bookmark the ', 'thematic') . '<a href="' . apply_filters('the_permalink', get_permalink()) . '" title="' . __('Permalink to ', 'thematic') . the_title_attribute('echo=0') . '">';
     $postconnect .= __('permalink', 'thematic') . '</a>.';
     if (comments_open() && pings_open()) {
         /* Comments are open */
         $postconnect .= ' <a class="comment-link" href="#respond" title ="' . __('Post a comment', 'thematic') . '">' . __('Post a comment', 'thematic') . '</a>';
         $postconnect .= __(' or leave a trackback: ', 'thematic');
         $postconnect .= '<a class="trackback-link" href="' . get_trackback_url() . '" title ="' . __('Trackback URL for your post', 'thematic') . '" rel="trackback">' . __('Trackback URL', 'thematic') . '</a>.';
     } elseif (!comments_open() && pings_open()) {
         /* Only trackbacks are open */
         $postconnect .= __(' Comments are closed, but you can leave a trackback: ', 'thematic');
         $postconnect .= '<a class="trackback-link" href="' . get_trackback_url() . '" title ="' . __('Trackback URL for your post', 'thematic') . '" rel="trackback">' . __('Trackback URL', 'thematic') . '</a>.';
     } elseif (comments_open() && !pings_open()) {
         /* Only comments open */
         $postconnect .= __(' Trackbacks are closed, but you can ', 'thematic');
         $postconnect .= '<a class="comment-link" href="#respond" title ="' . __('Post a comment', 'thematic') . '">' . __('post a comment', 'thematic') . '</a>.';
     } elseif (!comments_open() && !pings_open()) {
         /* Comments and trackbacks closed */
         $postconnect .= __(' Both comments and trackbacks are currently closed.', 'thematic');
     }
     // Display edit link on single posts
     if (current_user_can('edit_posts')) {
         $postconnect .= ' ' . thematic_postfooter_posteditlink();
     }
     return apply_filters('thematic_postfooter_postconnect', $postconnect);
 }
Esempio n. 3
0
 /**
  * Create the post footer
  * 
  * Override: childtheme_override_postfooter <br>
  * Filter: thematic_postfooter
  */
 function thematic_postfooter()
 {
     $post_type = get_post_type();
     $post_type_obj = get_post_type_object($post_type);
     // Check for "Page" post-type and logged in user to show edit link
     if ($post_type == 'page' && current_user_can('edit_posts')) {
         $postfooter = '<div class="entry-utility">' . thematic_postfooter_posteditlink();
         $postfooter .= "</div><!-- .entry-utility -->\n";
         // Display nothing for logged out users on a "Page" post-type
     } elseif ($post_type == 'page') {
         $postfooter = '';
         // For post-types other than "Pages" press on
     } else {
         $postfooter = '<div class="entry-utility">';
         if (is_single()) {
             $post_type_archive_link = function_exists('get_post_type_archive_link') ? get_post_type_archive_link($post_type) : home_url('/?post_type=' . $post_type);
             if (thematic_is_custom_post_type() && $post_type_obj->has_archive) {
                 $postfooter .= __('Browse the ', 'thematic') . '<a href="' . $post_type_archive_link . '" title="' . __('Permalink to ', 'thematic') . $post_type_obj->labels->singular_name . __(' Archive', 'thematic') . '">';
                 $postfooter .= $post_type_obj->labels->singular_name . '</a>' . __(' archive', 'thematic') . '. ';
             }
             $postfooter .= thematic_postfooter_posttax();
             $postfooter .= __('Bookmark the ', 'thematic') . '<a href="' . apply_filters('the_permalink', get_permalink()) . '" title="' . __('Permalink to ', 'thematic') . the_title_attribute('echo=0') . '">';
             $postfooter .= __('permalink', 'thematic') . '</a>. ';
             if (post_type_supports($post_type, 'comments')) {
                 $postfooter .= thematic_postfooter_postconnect();
             }
         } elseif (post_type_supports($post_type, 'comments')) {
             $postfooter .= thematic_postfooter_posttax();
             $postfooter .= thematic_postfooter_postcomments();
         }
         // Display edit link
         if (current_user_can('edit_posts')) {
             if (!is_single() && post_type_supports($post_type, 'comments')) {
                 $postfooter .= "\n\n\t\t\t\t\t\t" . '<span class="meta-sep meta-sep-edit">|</span> ';
             }
             $postfooter .= ' ' . thematic_postfooter_posteditlink();
         }
         $postfooter .= "\n\n\t\t\t\t\t</div><!-- .entry-utility -->\n";
     }
     // Put it on the screen
     echo apply_filters('thematic_postfooter', $postfooter);
     // Filter to override default post footer
 }
Esempio n. 4
0
function ntp_post_footer($content)
{
    if (is_home()) {
        return '';
    } elseif (is_search() && (get_post_type() === 'post' || get_post_type() === 'ntp_project') || is_singular() && (get_post_type() === 'post' || get_post_type() === 'ntp_project')) {
        if (current_user_can('edit_posts')) {
            $postfooter = '<div class="entry-utility">' . thematic_postfooter_posteditlink();
            $postfooter .= "</div><!-- .entry-utility -->\n";
            return $postfooter;
        } else {
            return '';
        }
    } else {
        return $content;
    }
}