ThemeShaper Forums » Thematic

[closed]

Changing postfooter on single posts

(3 posts)
  • Started 2 years ago by Sabra
  • Latest reply from helgatheviking
  • This topic is not resolved

Tags:

  1. I'm trying to change the trackback and bookmark links in the postfooter for a single post. I have the following function, but it's not working. It worked fine on the frontpage, but I am a bit of a PHP noob so I'm hoping someone here can help me out.

    // change trackback etc. for single post
    
    	function childtheme_postfooter_postconnect() {
    
    	    $postconnect = __('. Boekmark ', '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('childtheme_postfooter_postconnect',$postconnect); 
    
    } // end postfooter_postconnect
    Posted 2 years ago #
  2. Hi Sabra, Seems like you missed a small bit of text.. the function should be an childtheme overide. It should read like this..

    function childtheme_override_postfooter_postconnect() {
        # code...
    }

    If you've placed this code in the functions.php in your child theme and you make the above change, it should work fine.

    Posted 2 years ago #
  3. if you only need to change it on single pages then you might want to try targeting the thematic_postfooter_postconnect FILTER

    read my explanation of filters:
    http://forums.themeshaper.com/topic/need-help-understanding-actions-vs-filters-and-changing-post-meta-and-utility#post-22638

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.